Module: GraphQL::StaticValidation::FragmentsAreNamed

Defined in:
lib/graphql/static_validation/rules/fragments_are_named.rb

Instance Method Summary collapse

Instance Method Details

#on_fragment_definition(node, _parent) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/graphql/static_validation/rules/fragments_are_named.rb', line 5

def on_fragment_definition(node, _parent)
  if node.name.nil?
    add_error(GraphQL::StaticValidation::FragmentsAreNamedError.new(
      "Fragment definition has no name",
      nodes: node
    ))
  end
  super
end