Sha256: 579d679582f1418b7fc43e2217b914905f645181b2f1de55aad61b45da84bd64

Contents?: true

Size: 901 Bytes

Versions: 20

Compression:

Stored size: 901 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, extensions: nil)
        super(message, path: path, nodes: nodes)
        @type_name = type
        @argument_name = argument
        @extensions = extensions
      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? }
        extensions.merge!(@extensions) unless @extensions.nil?
        super.merge({
          "extensions" => extensions
        })
      end

      def code
        "argumentLiteralsIncompatible"
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
graphql-1.9.21 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.20 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.10.4 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.10.3 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.10.2 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.19 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.10.1 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.10.0 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.10.0.pre4 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.18 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.10.0.pre3 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.17 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.10.0.pre2 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.16 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.15 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.14 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.10.0.pre1 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.13 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.12 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
graphql-1.9.11 lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb