We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fc0b1f3 + 8ff637f commit 7c17f05Copy full SHA for 7c17f05
lib/graphql/language/visitor.rb
@@ -96,8 +96,8 @@ def on_abstract_node(node, parent)
96
else
97
# Run hooks if there are any
98
new_node = node
99
- begin_hooks_ok = @visitors.empty? || begin_visit(new_node, parent)
100
- if begin_hooks_ok
+ no_hooks = !@visitors.key?(node.class)
+ if no_hooks || begin_visit(new_node, parent)
101
node.children.each do |child_node|
102
new_child_and_node = on_node_with_modifications(child_node, new_node)
103
# Reassign `node` in case the child hook makes a modification
@@ -106,7 +106,7 @@ def on_abstract_node(node, parent)
106
end
107
108
109
- @visitors.any? && end_visit(new_node, parent)
+ end_visit(new_node, parent) unless no_hooks
110
111
if new_node.equal?(node)
112
nil
0 commit comments