class GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError
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], ?type: String?) → void
Source
# File lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb, line 20 def initialize(message, name:, error_type:, path: nil, nodes: [], type: nil) super(message, path: path, nodes: nodes) @variable_name = name #: String @type_name = type #: 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/variable_default_values_are_correctly_typed_error.rb, line 42 def code @violation end
# File lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb, line 30 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