Sha256: 10ed63ae09227801a8d36cf03cbbbb405192ff0295f89e079a9de3a461db0420

Contents?: true

Size: 480 Bytes

Versions: 36

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

module GraphQL
  module Types
    class BigInt < GraphQL::Schema::Scalar
      description "Represents non-fractional signed whole numeric values. Since the value may exceed the size of a 32-bit integer, it's encoded as a string."

      def self.coerce_input(value, _ctx)
        value && Integer(value)
      rescue ArgumentError
        nil
      end

      def self.coerce_result(value, _ctx)
        value.to_i.to_s
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
graphql-1.11.10 lib/graphql/types/big_int.rb
graphql-1.11.9 lib/graphql/types/big_int.rb
graphql-1.12.15 lib/graphql/types/big_int.rb
graphql-1.12.14 lib/graphql/types/big_int.rb
graphql-1.12.13 lib/graphql/types/big_int.rb
graphql-1.12.12 lib/graphql/types/big_int.rb
graphql-1.12.11 lib/graphql/types/big_int.rb
graphql-1.12.10 lib/graphql/types/big_int.rb
graphql-1.12.9 lib/graphql/types/big_int.rb
graphql-1.12.8 lib/graphql/types/big_int.rb
graphql-1.12.7 lib/graphql/types/big_int.rb
graphql-1.12.6 lib/graphql/types/big_int.rb
graphql-1.12.5 lib/graphql/types/big_int.rb
graphql-1.11.8 lib/graphql/types/big_int.rb
graphql-1.12.4 lib/graphql/types/big_int.rb
graphql-1.12.3 lib/graphql/types/big_int.rb
graphql-1.12.2 lib/graphql/types/big_int.rb
graphql-1.12.1 lib/graphql/types/big_int.rb
graphql-1.12.0 lib/graphql/types/big_int.rb
graphql-1.11.7 lib/graphql/types/big_int.rb