class GraphQL::StaticValidation::VariablesAreUsedAndDefinedError
Constants
- VIOLATIONS
Attributes
Public Class Methods
(String message, name: String, error_type: String, ?path: Array[String | Integer]?, ?nodes: GraphQL::Language::Nodes::AbstractNode | Array[GraphQL::Language::Nodes::AbstractNode]) → void
Source
# File lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb, line 18 def initialize(message, name:, error_type:, path: nil, nodes: []) super(message, path: path, nodes: nodes) @variable_name = name #: String raise("Unexpected error type: #{error_type}") if !VIOLATIONS.values.include?(error_type) @violation = error_type #: String end
Calls superclass method
GraphQL::StaticValidation::Error::new
Public Instance Methods
# File lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb, line 39 def code @violation end
# File lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb, line 27 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