class GraphQL::StaticValidation::VariablesAreUsedAndDefinedError
Constants
- VIOLATIONS
Attributes
Public Class Methods
# File lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb, line 14 def initialize(message, path: nil, nodes: [], name:, error_type:) super(message, path: path, nodes: nodes) @variable_name = name raise("Unexpected error type: #{error_type}") if !VIOLATIONS.values.include?(error_type) @violation = error_type end
Calls superclass method
GraphQL::StaticValidation::Error::new
Public Instance Methods
Source
# File lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb, line 33 def code @violation end
Source
# File lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb, line 22 def to_h extensions = { "code" => code, "variableName" => variable_name } super.merge({ "extensions" => extensions }) end
A hash representation of this Message
Calls superclass method
GraphQL::StaticValidation::Error#to_h