lib/graphql/language/nodes.rb in graphql-1.12.24 vs lib/graphql/language/nodes.rb in graphql-1.13.0
- old
+ new
@@ -195,20 +195,11 @@
alias :children #{children_of_type.keys.first}
RUBY
else
module_eval <<-RUBY, __FILE__, __LINE__
def children
- @children ||= begin
- if #{children_of_type.keys.map { |k| "@#{k}.any?" }.join(" || ")}
- new_children = []
- #{children_of_type.keys.map { |k| "new_children.concat(@#{k})" }.join("; ")}
- new_children.freeze
- new_children
- else
- NO_CHILDREN
- end
- end
+ @children ||= (#{children_of_type.keys.map { |k| "@#{k}" }.join(" + ")}).freeze
end
RUBY
end
end
@@ -474,11 +465,10 @@
value
end
end
end
-
# A list type definition, denoted with `[...]` (used for variable type definitions)
class ListType < WrapperType
end
# A non-null type definition, denoted with `...!` (used for variable type definitions)
@@ -625,18 +615,20 @@
class InterfaceTypeDefinition < AbstractNode
include DefinitionNode
attr_reader :description
scalar_methods :name
children_methods({
+ interfaces: GraphQL::Language::Nodes::TypeName,
directives: GraphQL::Language::Nodes::Directive,
fields: GraphQL::Language::Nodes::FieldDefinition,
})
self.children_method_name = :definitions
end
class InterfaceTypeExtension < AbstractNode
scalar_methods :name
children_methods({
+ interfaces: GraphQL::Language::Nodes::TypeName,
directives: GraphQL::Language::Nodes::Directive,
fields: GraphQL::Language::Nodes::FieldDefinition,
})
self.children_method_name = :definitions
end