scalars: ID and String support for serializing BigInt#3109
Closed
Hkmu wants to merge 1 commit intographql:mainfrom
Closed
scalars: ID and String support for serializing BigInt#3109Hkmu wants to merge 1 commit intographql:mainfrom
Hkmu wants to merge 1 commit intographql:mainfrom
Conversation
|
|
|
This would be extremely handy! I'm about to switch to representing ids as |
Contributor
|
I think it would make sense to use a custom scalar for BigInt a la https://the-guild.dev/graphql/scalars/docs/scalars/big-int |
Contributor
|
I misunderstood, this is for coercion of values from BigInt to string/id, not to int, this is reasonable, see discussion at newer PR #4088 |
Merged
yaacovCR
added a commit
that referenced
this pull request
Feb 11, 2026
building on prior work: - #3109 - #3973 - #4088 - #4223 - #4276 This PR adds bigint support to: - GraphQLInt, including input/output coercion, throwing if out of bounds, and new default value programmatic default value to literal - GraphQLFloat, including input/output coercion, throwing if cannot be represented, including with any loss of precision. - GraphQLString, output coercion only, like number - GraphQLBoolean, output coercion only, like number - GraphQLID, output and input coercion, in parallel to number, and new default value programmatic default value to literal Also, for custom scalars: - updates the `defaultScalarValueToLiteral` to convert a `bigint` to an Int literal - updates for deprecated `astFromValue` for passthrough custom scalars, i.e. scalars that return `bigint` from coerceOutputValue/serialize, to convert `bigint` to an Int literal. cf. also #3913 Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: jdecroock <decroockjovi@gmail.com> Co-authored-by: Hkmu <3169251+hkmu@users.noreply.github.com> Co-authored-by: xonx <119700621+xonx4l@users.noreply.github.com>
yaacovCR
added a commit
that referenced
this pull request
Feb 22, 2026
building on prior work: - #3109 - #3973 - #4088 - #4223 - #4276 This PR adds bigint support to: - GraphQLInt, including input/output coercion, throwing if out of bounds, and new default value programmatic default value to literal - GraphQLFloat, including input/output coercion, throwing if cannot be represented, including with any loss of precision. - GraphQLString, output coercion only, like number - GraphQLBoolean, output coercion only, like number - GraphQLID, output and input coercion, in parallel to number, and new default value programmatic default value to literal Also, for custom scalars: - updates the `defaultScalarValueToLiteral` to convert a `bigint` to an Int literal - updates for deprecated `astFromValue` for passthrough custom scalars, i.e. scalars that return `bigint` from coerceOutputValue/serialize, to convert `bigint` to an Int literal. cf. also #3913 Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: jdecroock <decroockjovi@gmail.com> Co-authored-by: Hkmu <3169251+hkmu@users.noreply.github.com> Co-authored-by: xonx <119700621+xonx4l@users.noreply.github.com>
yaacovCR
added a commit
that referenced
this pull request
Feb 22, 2026
building on prior work: - #3109 - #3973 - #4088 - #4223 - #4276 This PR adds bigint support to: - GraphQLInt, including input/output coercion, throwing if out of bounds, and new default value programmatic default value to literal - GraphQLFloat, including input/output coercion, throwing if cannot be represented, including with any loss of precision. - GraphQLString, output coercion only, like number - GraphQLBoolean, output coercion only, like number - GraphQLID, output and input coercion, in parallel to number, and new default value programmatic default value to literal Also, for custom scalars: - updates the `defaultScalarValueToLiteral` to convert a `bigint` to an Int literal - updates for deprecated `astFromValue` for passthrough custom scalars, i.e. scalars that return `bigint` from coerceOutputValue/serialize, to convert `bigint` to an Int literal. cf. also #3913 Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: jdecroock <decroockjovi@gmail.com> Co-authored-by: Hkmu <3169251+hkmu@users.noreply.github.com> Co-authored-by: xonx <119700621+xonx4l@users.noreply.github.com>
yaacovCR
added a commit
that referenced
this pull request
Feb 23, 2026
building on prior work: - #3109 - #3973 - #4088 - #4223 - #4276 This PR adds bigint support to: - GraphQLInt, including input/output coercion, throwing if out of bounds, and new default value programmatic default value to literal - GraphQLFloat, including input/output coercion, throwing if cannot be represented, including with any loss of precision. - GraphQLString, output coercion only, like number - GraphQLBoolean, output coercion only, like number - GraphQLID, output and input coercion, in parallel to number, and new default value programmatic default value to literal Also, for custom scalars: - updates the `defaultScalarValueToLiteral` to convert a `bigint` to an Int literal - updates for deprecated `astFromValue` for passthrough custom scalars, i.e. scalars that return `bigint` from coerceOutputValue/serialize, to convert `bigint` to an Int literal. cf. also #3913 Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: jdecroock <decroockjovi@gmail.com> Co-authored-by: Hkmu <3169251+hkmu@users.noreply.github.com> Co-authored-by: xonx <119700621+xonx4l@users.noreply.github.com>
yaacovCR
added a commit
that referenced
this pull request
Feb 23, 2026
building on prior work: - #3109 - #3973 - #4088 - #4223 - #4276 This PR adds bigint support to: - GraphQLInt, including input/output coercion, throwing if out of bounds, and new default value programmatic default value to literal - GraphQLFloat, including input/output coercion, throwing if cannot be represented, including with any loss of precision. - GraphQLString, output coercion only, like number - GraphQLBoolean, output coercion only, like number - GraphQLID, output and input coercion, in parallel to number, and new default value programmatic default value to literal Also, for custom scalars: - updates the `defaultScalarValueToLiteral` to convert a `bigint` to an Int literal - updates for deprecated `astFromValue` for passthrough custom scalars, i.e. scalars that return `bigint` from coerceOutputValue/serialize, to convert `bigint` to an Int literal. cf. also #3913 Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: jdecroock <decroockjovi@gmail.com> Co-authored-by: Hkmu <3169251+hkmu@users.noreply.github.com> Co-authored-by: xonx <119700621+xonx4l@users.noreply.github.com>
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
building on prior work: - #3109 - #3973 - #4088 - #4223 - #4276 This PR adds bigint support to: - GraphQLInt, including input/output coercion, throwing if out of bounds, and new default value programmatic default value to literal - GraphQLFloat, including input/output coercion, throwing if cannot be represented, including with any loss of precision. - GraphQLString, output coercion only, like number - GraphQLBoolean, output coercion only, like number - GraphQLID, output and input coercion, in parallel to number, and new default value programmatic default value to literal Also, for custom scalars: - updates the `defaultScalarValueToLiteral` to convert a `bigint` to an Int literal - updates for deprecated `astFromValue` for passthrough custom scalars, i.e. scalars that return `bigint` from coerceOutputValue/serialize, to convert `bigint` to an Int literal. cf. also #3913 Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: jdecroock <decroockjovi@gmail.com> Co-authored-by: Hkmu <3169251+hkmu@users.noreply.github.com> Co-authored-by: xonx <119700621+xonx4l@users.noreply.github.com>
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
building on prior work: - #3109 - #3973 - #4088 - #4223 - #4276 This PR adds bigint support to: - GraphQLInt, including input/output coercion, throwing if out of bounds, and new default value programmatic default value to literal - GraphQLFloat, including input/output coercion, throwing if cannot be represented, including with any loss of precision. - GraphQLString, output coercion only, like number - GraphQLBoolean, output coercion only, like number - GraphQLID, output and input coercion, in parallel to number, and new default value programmatic default value to literal Also, for custom scalars: - updates the `defaultScalarValueToLiteral` to convert a `bigint` to an Int literal - updates for deprecated `astFromValue` for passthrough custom scalars, i.e. scalars that return `bigint` from coerceOutputValue/serialize, to convert `bigint` to an Int literal. cf. also #3913 Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: jdecroock <decroockjovi@gmail.com> Co-authored-by: Hkmu <3169251+hkmu@users.noreply.github.com> Co-authored-by: xonx <119700621+xonx4l@users.noreply.github.com>
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
building on prior work: - #3109 - #3973 - #4088 - #4223 - #4276 This PR adds bigint support to: - GraphQLInt, including input/output coercion, throwing if out of bounds, and new default value programmatic default value to literal - GraphQLFloat, including input/output coercion, throwing if cannot be represented, including with any loss of precision. - GraphQLString, output coercion only, like number - GraphQLBoolean, output coercion only, like number - GraphQLID, output and input coercion, in parallel to number, and new default value programmatic default value to literal Also, for custom scalars: - updates the `defaultScalarValueToLiteral` to convert a `bigint` to an Int literal - updates for deprecated `astFromValue` for passthrough custom scalars, i.e. scalars that return `bigint` from coerceOutputValue/serialize, to convert `bigint` to an Int literal. cf. also #3913 Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: jdecroock <decroockjovi@gmail.com> Co-authored-by: Hkmu <3169251+hkmu@users.noreply.github.com> Co-authored-by: xonx <119700621+xonx4l@users.noreply.github.com>
yaacovCR
added a commit
that referenced
this pull request
Feb 24, 2026
building on prior work: - #3109 - #3973 - #4088 - #4223 - #4276 This PR adds bigint support to: - GraphQLInt, including input/output coercion, throwing if out of bounds, and new default value programmatic default value to literal - GraphQLFloat, including input/output coercion, throwing if cannot be represented, including with any loss of precision. - GraphQLString, output coercion only, like number - GraphQLBoolean, output coercion only, like number - GraphQLID, output and input coercion, in parallel to number, and new default value programmatic default value to literal Also, for custom scalars: - updates the `defaultScalarValueToLiteral` to convert a `bigint` to an Int literal - updates for deprecated `astFromValue` for passthrough custom scalars, i.e. scalars that return `bigint` from coerceOutputValue/serialize, to convert `bigint` to an Int literal. cf. also #3913 Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com> Co-authored-by: jdecroock <decroockjovi@gmail.com> Co-authored-by: Hkmu <3169251+hkmu@users.noreply.github.com> Co-authored-by: xonx <119700621+xonx4l@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add support to serialize BigInt for String and ID scalar.