class GraphQL::StaticValidation::VariablesAreUsedAndDefinedError

def code

def code
  @violation
end

def initialize(message, path: nil, nodes: [], name:, error_type:)

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

def to_h

A hash representation of this Message
def to_h
  extensions = {
    "code" => code,
    "variableName" => variable_name
  }
  super.merge({
    "extensions" => extensions
  })
end