Use a custom type for big integers #328
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #302
This PR makes it so that PostGraphQL no longer uses the native GraphQL
Int
type to represent big integers (as a big integer can be larger thanInt
allows). So instead we now have aBigInt
type which serializes and deserializes as a string. It is a string because in JavaScript a big integer can be larger than what a number supports. To get around that limitation all big integers will be strings. If you’d like you can parse big integers on the client.This is a breaking change I’ve wanted to make for a while, so now that we need a breaking change for #327 I want to get this change into
3.x
as well.