Skip to content

Commit 439ef03

Browse files
committed
Improve NoTypedChildren compat
1 parent 36efd73 commit 439ef03

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • lib/graphql/internal_representation

lib/graphql/internal_representation/node.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,17 @@ class NoTypedChildren
1212
CHILDREN = [].freeze
1313
def dup; self; end
1414
def any?; false; end
15+
def none?; true; end
1516
def [](key); CHILDREN; end
1617
def each; end
18+
# Compatibility for when this was an Array:
19+
def method_missing(method_name, *args, &block)
20+
if CHILDREN.respond_to?(method_name)
21+
CHILDREN.send(method_name, *args, &block)
22+
else
23+
raise NotImplementedError
24+
end
25+
end
1726
end
1827
NO_TYPED_CHILDREN = NoTypedChildren.new
1928

0 commit comments

Comments
 (0)