-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
implement default value coercion and validation #2325
Conversation
return (Value<?>) parseImpl(multiSourceReader, nodeFunction); | ||
} | ||
|
||
private Node parseImpl(Reader reader, BiFunction<GraphqlParser, GraphqlAntlrToLanguage, Object[]> nodeFunction) throws InvalidSyntaxException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice trick
src/main/java/graphql/schema/validation/AppliedDirectiveArgumentsAreValid.java
Show resolved
Hide resolved
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 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/value
andGraphQLInputObject.defaultValue
are renamed toargumentDefaultValue/argumentValue
andinputFieldDefaultValue
.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
GraphQLArgument
andGraphQLInputObjectField