64-bit integers
samzhang111 opened this issue · comments
Looks like ints are being casted as int32:
Line 728 in 566b9f5
A few lines above, ints are parsed as 64-bit though:
Line 723 in 566b9f5
Why not leave everything as 64-bit? I am using this library and got an overflow of an int field that holds milliseconds since the epoch (Unix time * 1000), since that is bigger than 2^32
Just saw that Facebook spec'd 32-bit integers: http://facebook.github.io/graphql/#sec-Int
Carry on...
Reopening to ask whether there is consideration for adding a custom Long
datatype:
- Custom scalars are encouraged, with the
long
type specifically mentioned: graphql/graphql-spec#73 - Other implementations, such as sangria, do it: http://sangria-graphql.org/learn/#scalar-types
We do make extensive use of custom scalars and they are implemented though documentation is a little lacking. Here's an example in a test case:
https://github.com/playlyfe/go-graphql/blob/master/executor_test.go#L1746-L1777
You need to declare the scalar in the schema scalar <Your Scalar Name>
and then the entry to the executor.Scalars map as shown in the test case.