Exception: GraphQL::Query::VariableValidationError
- Inherits:
-
ExecutionError
- Object
- StandardError
- Error
- ExecutionError
- GraphQL::Query::VariableValidationError
- Defined in:
- lib/graphql/query/variable_validation_error.rb
Instance Attribute Summary collapse
-
#validation_result ⇒ Object
Returns the value of attribute validation_result.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from ExecutionError
Instance Method Summary collapse
-
#initialize(variable_ast, type, value, validation_result) ⇒ VariableValidationError
constructor
A new instance of VariableValidationError.
- #to_h ⇒ Object
Constructor Details
#initialize(variable_ast, type, value, validation_result) ⇒ VariableValidationError
Returns a new instance of VariableValidationError.
7 8 9 10 11 12 13 14 |
# File 'lib/graphql/query/variable_validation_error.rb', line 7 def initialize(variable_ast, type, value, validation_result) @value = value @validation_result = validation_result msg = "Variable #{variable_ast.name} of type #{type} was provided invalid value" super(msg) self.ast_node = variable_ast end |
Instance Attribute Details
#validation_result ⇒ Object
Returns the value of attribute validation_result.
5 6 7 |
# File 'lib/graphql/query/variable_validation_error.rb', line 5 def validation_result @validation_result end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/graphql/query/variable_validation_error.rb', line 5 def value @value end |
Instance Method Details
#to_h ⇒ Object
16 17 18 |
# File 'lib/graphql/query/variable_validation_error.rb', line 16 def to_h super.merge({ "value" => value, "problems" => validation_result.problems }) end |