-
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
ease upgrade path for programmatic default values #4296
base: main
Are you sure you want to change the base?
Conversation
✅ 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:
|
To summarize, cross-posting from #4288 (comment):In v16, the available default value option on In v17 currently, prior to the proposed #4296, we adopted @leebyron 's work and replaced that with two options, After #4296, we have both. On the config, to disambiguate, we use Converting from the old to new and vice a versaCoercing the external values for the defaults to the input values can be done easily using the If you want to safely turn an internal value into something external, we have no function to do this in v16 or v17. But if you want, you can do what's done unsafely in v16 for introspection, you can use |
#3814 added default value validation and coercion, deprecating
astFromValue()
(which was unsafe, usedserialize()
to uncoerce input values provided in the internal format) and replacing it with a call tovalueToLiteral()
which safely operates on external values.This PR makes that change backwards compatible by reintroducing it as a new config option of externalDefaultValue instead of replacing the existing option of defaultValue.
defaultValueLiteral stays as its open top-level config option, but is subsumed under externalDefaultValue within the GraphQLArgument/GraphQLInputField as it is always external.