Class: GraphQL::StaticValidation::OneOfInputObjectsAreValidError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, path:, nodes:, input_object_type:) ⇒ OneOfInputObjectsAreValidError

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



11
12
13
14
# File 'lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb', line 11

def initialize(message, path:, nodes:, input_object_type:)
  super(message, path: path, nodes: nodes)
  @input_object_type = input_object_type #: String
end

Instance Attribute Details

#input_object_type ⇒ Object (readonly)

: String



8
9
10
# File 'lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb', line 8

def input_object_type
  @input_object_type
end

Instance Method Details

#code ⇒ Object

: -> String



30
31
32
# File 'lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb', line 30

def code
  "invalidOneOfInputObject"
end

#to_h ⇒ Object

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



18
19
20
21
22
23
24
25
26
27
# File 'lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb', line 18

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

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