lib/graphql/analysis/ast/field_usage.rb in graphql-1.12.22 vs lib/graphql/analysis/ast/field_usage.rb in graphql-1.12.23
- old
+ new
@@ -13,11 +13,15 @@
def on_leave_field(node, parent, visitor)
field_defn = visitor.field_definition
field = "#{visitor.parent_type_definition.graphql_name}.#{field_defn.graphql_name}"
@used_fields << field
@used_deprecated_fields << field if field_defn.deprecation_reason
-
- extract_deprecated_arguments(visitor.query.arguments_for(node, visitor.field_definition).argument_values)
+ arguments = visitor.query.arguments_for(node, visitor.field_definition)
+ # If there was an error when preparing this argument object,
+ # then this might be an error or something:
+ if arguments.respond_to?(:argument_values)
+ extract_deprecated_arguments(arguments.argument_values)
+ end
end
def result
{
used_fields: @used_fields.to_a,