module GraphQL::StaticValidation::FragmentSpreadsArePossible
Public Class Methods
Source
# File lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb, line 8 def initialize(*) super @spreads_to_validate = [] end
Calls superclass method
Public Instance Methods
Source
# File lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb, line 28 def on_document(node, parent) super @spreads_to_validate.each do |frag_spread| frag_node = context.fragments[frag_spread.node.name] if frag_node fragment_child_name = frag_node.type.name fragment_child = @types.type(fragment_child_name) # Might be non-existent type name if fragment_child validate_fragment_in_scope(frag_spread.parent_type, fragment_child, frag_spread.node, context, frag_spread.path) end end end end
Calls superclass method
# File lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb, line 22 def on_fragment_spread(node, parent) fragment_parent = @current_object_type @spreads_to_validate << FragmentSpread.new(node: node, parent_type: fragment_parent, path: context.path) super end
Calls superclass method
# File lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb, line 13 def on_inline_fragment(node, parent) fragment_parent = @parent_object_type fragment_child = @current_object_type if fragment_child validate_fragment_in_scope(fragment_parent, fragment_child, node, context, context.path) end super end
Calls superclass method