Sha256: 582846dcdf07634a153c6ed674f5541008490fd770c99b02d4fd84c672e47f51

Contents?: true

Size: 789 Bytes

Versions: 14

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module StaticValidation
    class ArgumentLiteralsAreCompatibleError < StaticValidation::Error
      attr_reader :type_name
      attr_reader :argument_name

      def initialize(message, path: nil, nodes: [], type:, argument: nil)
        super(message, path: path, nodes: nodes)
        @type_name = type
        @argument_name = argument
      end

      # A hash representation of this Message
      def to_h
        extensions = {
          "code" => code,
          "typeName" => type_name
        }.tap { |h| h["argumentName"] = argument_name unless argument_name.nil? }

        super.merge({
          "extensions" => extensions
        })
      end

      def code
        "argumentLiteralsIncompatible"
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
graphql-1.9.10 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.9 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.8 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.7 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.6 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.5 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.4 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.3 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.2 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.1 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.0 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.0.pre4 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.0.pre3 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.0.pre2 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb