Sha256: 5ef8db07c834cc2574ff5c697d76da80b4c8c109a308d1ee708d3c09a815fc63

Contents?: true

Size: 588 Bytes

Versions: 77

Compression:

Stored size: 588 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  class Query
    class VariableValidationError < GraphQL::ExecutionError
      attr_accessor :value, :validation_result

      def initialize(variable_ast, type, value, validation_result)
        @value = value
        @validation_result = validation_result

        msg = "Variable #{variable_ast.name} of type #{type} was provided invalid value"
        super(msg)
        self.ast_node = variable_ast
      end

      def to_h
        super.merge({ "value" => value, "problems" => validation_result.problems })
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
graphql-1.5.12 lib/graphql/query/variable_validation_error.rb
graphql-1.5.11 lib/graphql/query/variable_validation_error.rb
graphql-1.5.10 lib/graphql/query/variable_validation_error.rb
graphql-1.5.9 lib/graphql/query/variable_validation_error.rb
graphql-1.5.8 lib/graphql/query/variable_validation_error.rb
graphql-1.5.7 lib/graphql/query/variable_validation_error.rb
graphql-1.5.6 lib/graphql/query/variable_validation_error.rb
graphql-1.5.5 lib/graphql/query/variable_validation_error.rb
graphql-1.5.4 lib/graphql/query/variable_validation_error.rb
graphql-1.5.3 lib/graphql/query/variable_validation_error.rb
graphql-1.4.5 lib/graphql/query/variable_validation_error.rb
graphql-1.4.4 lib/graphql/query/variable_validation_error.rb
graphql-1.4.3 lib/graphql/query/variable_validation_error.rb
graphql-1.4.2 lib/graphql/query/variable_validation_error.rb
graphql-1.4.1 lib/graphql/query/variable_validation_error.rb
graphql-1.4.0 lib/graphql/query/variable_validation_error.rb
graphql-1.3.0 lib/graphql/query/variable_validation_error.rb