Sha256: 92073aafc9bfcfd075b1f0b25f3ce5351f5876d202149615aafa4afb980de4b4

Contents?: true

Size: 471 Bytes

Versions: 28

Compression:

Stored size: 471 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)
        Integer(value)
      rescue ArgumentError
        nil
      end

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

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
graphql-1.9.21 lib/graphql/types/big_int.rb
graphql-1.9.20 lib/graphql/types/big_int.rb
graphql-1.10.5 lib/graphql/types/big_int.rb
graphql-1.10.4 lib/graphql/types/big_int.rb
graphql-1.10.3 lib/graphql/types/big_int.rb
graphql-1.10.2 lib/graphql/types/big_int.rb
graphql-1.9.19 lib/graphql/types/big_int.rb
graphql-1.10.1 lib/graphql/types/big_int.rb
graphql-1.10.0 lib/graphql/types/big_int.rb
graphql-1.10.0.pre4 lib/graphql/types/big_int.rb
graphql-1.9.18 lib/graphql/types/big_int.rb
graphql-1.10.0.pre3 lib/graphql/types/big_int.rb
graphql-1.9.17 lib/graphql/types/big_int.rb
graphql-1.10.0.pre2 lib/graphql/types/big_int.rb
graphql-1.9.16 lib/graphql/types/big_int.rb
graphql-1.9.15 lib/graphql/types/big_int.rb
graphql-1.9.14 lib/graphql/types/big_int.rb
graphql-1.10.0.pre1 lib/graphql/types/big_int.rb
graphql-1.9.13 lib/graphql/types/big_int.rb
graphql-1.9.12 lib/graphql/types/big_int.rb