lib/graphql/execution/execute.rb in graphql-1.4.4 vs lib/graphql/execution/execute.rb in graphql-1.4.5
- old
+ new
@@ -40,9 +40,16 @@
if mutation
GraphQL::Execution::Lazy.resolve(field_result)
end
selection_result.set(name, field_result)
+
+ # If the last subselection caused a null to propagate to _this_ selection,
+ # then we may as well quit executing fields because they
+ # won't be in the response
+ if selection_result.invalid_null?
+ break
+ end
end
selection_result
end