GraphQL large integer error: Int cannot represent non 32-bit signed integer value GraphQL large integer error: Int cannot represent non 32-bit signed integer value mongoose mongoose

GraphQL large integer error: Int cannot represent non 32-bit signed integer value


GraphQL doesn't support integers larger than 32 bits as the error indicates. You're better off using a custom scalar like GraphQL Date. There's also a "Long" type available here. Or you could roll your own custom type; there's a great example from Apollo here.

If you're curious why GraphQL does not support anything bigger, you can check out this issue on Github.


⚠️Not recommended...

... but if you want a quick fix (maybe you don't have the time to implement a custom scalar), you can use the Float type instead of Int.