Class: GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError
- Defined in:
- lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
Instance Attribute Summary collapse
-
#argument_name ⇒ Object
readonly
Returns the value of attribute argument_name.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Attributes inherited from Error
Instance Method Summary collapse
-
#code ⇒ Object
-
#initialize(message, path: nil, nodes: [], type:, argument: nil, extensions: nil) ⇒ ArgumentLiteralsAreCompatibleError
constructor
A new instance of ArgumentLiteralsAreCompatibleError.
-
#to_h ⇒ Object
A hash representation of this Message.
Constructor Details
#initialize(message, path: nil, nodes: [], type:, argument: nil, extensions: nil) ⇒ ArgumentLiteralsAreCompatibleError
Returns a new instance of ArgumentLiteralsAreCompatibleError.
8 9 10 11 12 13 |
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 8 def initialize(, path: nil, nodes: [], type:, argument: nil, extensions: nil) super(, path: path, nodes: nodes) @type_name = type @argument_name = argument @extensions = extensions end |
Instance Attribute Details
#argument_name ⇒ Object (readonly)
Returns the value of attribute argument_name.
6 7 8 |
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 6 def argument_name @argument_name end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
5 6 7 |
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 5 def type_name @type_name end |
Instance Method Details
#code ⇒ Object
27 28 29 |
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 27 def code "argumentLiteralsIncompatible" end |
#to_h ⇒ Object
A hash representation of this Message
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 16 def to_h extensions = { "code" => code, "typeName" => type_name }.tap { |h| h["argumentName"] = argument_name unless argument_name.nil? } extensions.merge!(@extensions) unless @extensions.nil? super.merge({ "extensions" => extensions }) end |