class GraphQL::StaticValidation::FragmentsAreUsedError

Attributes

fragment_name[R]

Public Class Methods

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

Public Instance Methods

code() click to toggle source
# File lib/graphql/static_validation/rules/fragments_are_used_error.rb, line 24
def code
  "useAndDefineFragment"
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/fragments_are_used_error.rb, line 13
def to_h
  extensions = {
    "code" => code,
    "fragmentName" => fragment_name
  }

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