Sha256: 5de8ccc6035c986b9414b19e12f9860929685c13e2d7d5f0063e66880f31c354

Contents?: true

Size: 356 Bytes

Versions: 9

Compression:

Stored size: 356 Bytes

Contents

# frozen_string_literal: true
GraphQL::INT_TYPE = GraphQL::ScalarType.define do
  name "Int"
  description "Represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1."

  coerce_input ->(value) { value.is_a?(Numeric) ? value.to_i : nil }
  coerce_result ->(value) { value.to_i }
  default_scalar true
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
graphql-1.5.5 lib/graphql/int_type.rb
graphql-1.5.4 lib/graphql/int_type.rb
graphql-1.5.3 lib/graphql/int_type.rb
graphql-1.4.5 lib/graphql/int_type.rb
graphql-1.4.4 lib/graphql/int_type.rb
graphql-1.4.3 lib/graphql/int_type.rb
graphql-1.4.2 lib/graphql/int_type.rb
graphql-1.4.1 lib/graphql/int_type.rb
graphql-1.4.0 lib/graphql/int_type.rb