class GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError
Constants
- VIOLATIONS
Attributes
Public Class Methods
# File lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb, line 15 def initialize(message, path: nil, nodes: [], name:, type: nil, error_type:) super(message, path: path, nodes: nodes) @variable_name = name @type_name = type 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/variable_default_values_are_correctly_typed_error.rb, line 35 def code @violation end
Source
# File lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb, line 24 def to_h extensions = { "code" => code, "variableName" => variable_name }.tap { |h| h["typeName"] = type_name unless type_name.nil? } super.merge({ "extensions" => extensions }) end
A hash representation of this Message
Calls superclass method
GraphQL::StaticValidation::Error#to_h