-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve upgrade path for new custom scalar parseConstLiteral()
method
#4209
Merged
Conversation
This file contains 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
…parseConstValue() `parseValue()` has been marked as deprecated, prompting but not forcing our users to convert to `parseConstValue()`. With this additional change: - in v17, if not supplied, the new `parseConstValue()` method will be left as undefined, and during execution, we will fall back to`parseValue()`. - in v18, we will remove `parseValue()` and set up a default function for `parseConstValue()` when not supplied. Prior to this change, users of custom scalars with custom `parseValue()` functions who did not provide a custom `parseConstValue()` function would just get the default `parseConstValue()` function during execution, which might not work as expected. This scheme will work except for users of custom scalars who want to embed experimental fragment variables in their custom scalars, which will only work with the new `parseConstValue()` method.
✅ Deploy Preview for compassionate-pike-271cb3 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋 Supported commandsPlease post this commands in separate comments and only one per comment:
|
yaacovCR
changed the title
provide better upgrade experience for custom scalars for the move to …
provide better upgrade route for the new custom scalar Sep 30, 2024
parseConstValue()
method
yaacovCR
changed the title
provide better upgrade route for the new custom scalar
improve upgrade route for new custom scalar Sep 30, 2024
parseConstValue()
methodparseConstValue()
method
yaacovCR
changed the title
improve upgrade route for new custom scalar
improve upgrade path for new custom scalar Sep 30, 2024
parseConstValue()
methodparseConstValue()
method
yaacovCR
added
the
PR: breaking change 💥
implementation requires increase of "major" version number
label
Sep 30, 2024
yaacovCR
changed the title
improve upgrade path for new custom scalar
improve upgrade path for new custom scalar Sep 30, 2024
parseConstValue()
methodparseConstLiteral()
method
JoviDeCroock
approved these changes
Sep 30, 2024
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Sep 30, 2024
after the landing of graphql#4209, we don't have any breaking behavior (yet) in terms of input value coercion!
yaacovCR
added a commit
that referenced
this pull request
Oct 13, 2024
the new method was introduced in #3812 with upgrade path improved in #4209. This PR completes polishes this work a bit: 1. The method is renamed to `coerceInputLiteral()` following the naming convention suggested in #2357, with the other methods to be renamed in later PRs. 2. The type of the method `GraphQLScalarInputLiteralCoercer` is exported, which was not done in the initial work. The old `GraphQLScalarLiteralParser` type is deprecated.
yaacovCR
added a commit
to yaacovCR/graphql-js
that referenced
this pull request
Nov 27, 2024
after the landing of graphql#4209, we don't have any breaking behavior (yet) in terms of input value coercion!
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.
parseLiteral()
has been marked as deprecated, prompting but not forcing our users to convert toparseConstLiteral()
.With this additional change:
parseConstLiteral()
method will be left as undefined, and during execution, we will fall back toparseLiteral()
.parseLiteral()
and set up a default function forparseConstLiteral()
when not supplied.Prior to this change, users of custom scalars with custom
parseLiteral()
functions who did not provide a customparseConstLiteral()
function would just get the defaultparseConstLiteral()
function during execution, which might not work as expected.This scheme will work except for users of custom scalars who want to embed experimental fragment variables in their custom scalars, which will only work with the new
parseConstLiteral()
method.