Class: GraphQL::StaticValidation::RequiredInputObjectAttributesArePresentError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, path:, nodes:, argument_type:, argument_name:, input_object_type:) ⇒ RequiredInputObjectAttributesArePresentError

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



15
16
17
18
19
20
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb', line 15

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

Instance Attribute Details

#argument_name ⇒ Object (readonly)

: String



10
11
12
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb', line 10

def argument_name
  @argument_name
end

#argument_type ⇒ Object (readonly)

: String



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

def argument_type
  @argument_type
end

#input_object_type ⇒ Object (readonly)

: String



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

def input_object_type
  @input_object_type
end

Instance Method Details

#code ⇒ Object

: () -> String



38
39
40
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb', line 38

def code
  "missingRequiredInputObjectAttribute"
end

#to_h ⇒ Object

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



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb', line 24

def to_h
  extensions = {
    "code" => code,
    "argumentName" => argument_name,
    "argumentType" => argument_type,
    "inputObjectType" => input_object_type,
  }

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