Class: GraphQL::StaticValidation::VariableUsagesAreAllowedError
- Defined in:
- lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb
Instance Attribute Summary collapse
-
#argument_name ⇒ Object
readonly
Returns the value of attribute argument_name.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
-
#variable_name ⇒ Object
readonly
Returns the value of attribute variable_name.
Attributes inherited from Error
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(message, path: nil, nodes: [], type:, name:, argument:, error:) ⇒ VariableUsagesAreAllowedError
constructor
A new instance of VariableUsagesAreAllowedError.
-
#to_h ⇒ Object
A hash representation of this Message.
Constructor Details
#initialize(message, path: nil, nodes: [], type:, name:, argument:, error:) ⇒ VariableUsagesAreAllowedError
Returns a new instance of VariableUsagesAreAllowedError.
10 11 12 13 14 15 16 |
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 10 def initialize(, path: nil, nodes: [], type:, name:, argument:, error:) super(, path: path, nodes: nodes) @type_name = type @variable_name = name @argument_name = argument @error_message = error end |
Instance Attribute Details
#argument_name ⇒ Object (readonly)
Returns the value of attribute argument_name.
7 8 9 |
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 7 def argument_name @argument_name end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
8 9 10 |
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 8 def @error_message end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
5 6 7 |
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 5 def type_name @type_name end |
#variable_name ⇒ Object (readonly)
Returns the value of attribute variable_name.
6 7 8 |
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 6 def variable_name @variable_name end |
Instance Method Details
#code ⇒ Object
33 34 35 |
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 33 def code "variableMismatch" end |
#to_h ⇒ Object
A hash representation of this Message
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 19 def to_h extensions = { "code" => code, "variableName" => variable_name, "typeName" => type_name, "argumentName" => argument_name, "errorMessage" => } super.merge({ "extensions" => extensions }) end |