implement default value coercion and validation#2325
Merged
Conversation
bbakerman
reviewed
May 24, 2021
| return (Value<?>) parseImpl(multiSourceReader, nodeFunction); | ||
| } | ||
|
|
||
| private Node parseImpl(Reader reader, BiFunction<GraphqlParser, GraphqlAntlrToLanguage, Object[]> nodeFunction) throws InvalidSyntaxException { |
bbakerman
reviewed
May 24, 2021
bbakerman
approved these changes
May 24, 2021
|
Hello @andimarek et al! At the latest WG meeting, we again discussed advancing default value coercion/validation within the reference implementation. Just touching base at @IvanGoncharov 's suggestion to see if there have been any lessons learned from the implementation here? Anything working well -- or not so well -- in the 1.5 years since this has been live in Any feedback/commentary that might inform how the spec/reference implementation should look? |
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.
This PR adds one new coercing function which aim to resolves a long outstanding regarding custom Scalars and default value coercion:
Currently there is no well defined way for custom Scalar values to be printed as SDL.
Related to that default values are not properly coerced.
This also applies to applied schema directives which also contains values.
Breaking changes
Argument/InputObject defaultValue/values
GraphQLArgument.defaultValue/valueandGraphQLInputObject.defaultValueare renamed toargumentDefaultValue/argumentValueandinputFieldDefaultValue.We did this to signal clearly that the returned values changed. See JavaDoc for details.
Non standard scalars removed
We removed previously deprecated non standard Scalars (Long, short etc). These Scalars are still available via https://github.com/graphql-java/graphql-java-extended-scalars
Removed deprecated Constructors
Removed previously deprecated constructors for
GraphQLArgumentandGraphQLInputObjectField