Class: GraphQL::StaticValidation::FragmentsAreNamedError

Inherits:
Error
  • Object
show all
Defined in:
lib/graphql/static_validation/rules/fragments_are_named_error.rb

Instance Attribute Summary

Attributes inherited from Error

#message, #nodes, #path

Instance Method Summary collapse

Constructor Details

#initialize(message, path: nil, nodes: []) ⇒ FragmentsAreNamedError

Returns a new instance of FragmentsAreNamedError.



6
7
8
# File 'lib/graphql/static_validation/rules/fragments_are_named_error.rb', line 6

def initialize(message, path: nil, nodes: [])
  super(message, path: path, nodes: nodes)
end

Instance Method Details

#codeObject



21
22
23
# File 'lib/graphql/static_validation/rules/fragments_are_named_error.rb', line 21

def code
  "anonymousFragment"
end

#to_hObject

A hash representation of this Message



11
12
13
14
15
16
17
18
19
# File 'lib/graphql/static_validation/rules/fragments_are_named_error.rb', line 11

def to_h
  extensions = {
    "code" => code,
  }

  super.merge({
    "extensions" => extensions
  })
end