class GraphQL::StaticValidation::FragmentSpreadsArePossibleError

Attributes

fragment_name[R]
parent_name[R]
type_name[R]

Public Class Methods

new(message, path: nil, nodes: [], type:, fragment_name:, parent:) click to toggle source
Calls superclass method GraphQL::StaticValidation::Error::new
# File lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb, line 9
def initialize(message, path: nil, nodes: [], type:, fragment_name:, parent:)
  super(message, path: path, nodes: nodes)
  @type_name = type
  @fragment_name = fragment_name
  @parent_name = parent
end

Public Instance Methods

code() click to toggle source
# File lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb, line 30
def code
  "cannotSpreadFragment"
end
to_h() click to toggle source

A hash representation of this Message

Calls superclass method GraphQL::StaticValidation::Error#to_h
# File lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb, line 17
def to_h
  extensions = {
    "code" => code,
    "typeName" => type_name,
    "fragmentName" => fragment_name,
    "parentName" => parent_name
  }

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