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
def to_h extensions = { "code" => code, "variableName" => variable_name } super.merge({ "extensions" => extensions }) end