Exception: GraphQL::IntegerEncodingError

Inherits:
RuntimeTypeError show all
Defined in:
lib/graphql/integer_encoding_error.rb

Overview

This error is raised when Types::Int is asked to return a value outside of 32-bit integer range.

For values outside that range, consider:

  • ID for database primary keys or other identifiers
  • GraphQL::Types::BigInt for really big integer values

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ IntegerEncodingError

Returns a new instance of IntegerEncodingError.



15
16
17
18
# File 'lib/graphql/integer_encoding_error.rb', line 15

def initialize(value)
  @integer_value = value
  super("Integer out of bounds: #{value}. \nConsider using ID or GraphQL::Types::BigInt instead.")
end

Instance Attribute Details

#integer_valueObject (readonly)

The value which couldn’t be encoded



13
14
15
# File 'lib/graphql/integer_encoding_error.rb', line 13

def integer_value
  @integer_value
end