Class: GraphQL::StaticValidation::MutationRootExistsError

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

Instance Method Summary collapse

Constructor Details

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

: (String message, ?path: Array[String | Integer]?, ?nodes: GraphQL::Language::Nodes::AbstractNode | Array) -> void



9
10
11
# File 'lib/graphql/static_validation/rules/mutation_root_exists_error.rb', line 9

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

Instance Method Details

#code ⇒ Object

: -> String



26
27
28
# File 'lib/graphql/static_validation/rules/mutation_root_exists_error.rb', line 26

def code
  "missingMutationConfiguration"
end

#to_h ⇒ Object

A hash representation of this Message : -> Hash[String, untyped]



15
16
17
18
19
20
21
22
23
# File 'lib/graphql/static_validation/rules/mutation_root_exists_error.rb', line 15

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

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