deprecated default value method produces bad results#3286
Merged
Conversation
bbakerman
commented
Aug 10, 2023
| // but this code can know - its is SET to a value so, it MUST be a Null Literal | ||
| // this method would assert at the end of it if inputValueWithState.isNotSet() were true | ||
| // | ||
| return value == null ? NullValue.of() : value; |
Member
Author
There was a problem hiding this comment.
The comment outlines why this is safe - but what you cant see in this diff is if (inputValueWithState.isInternal()) being called. Since this is true then the value MUST have been set into the input value and hence we can turn the legacy null into a AST NullValue safely.
bbakerman
commented
Aug 10, 2023
| .directiveIsRepeatable(true) | ||
| .schemaDescription(true) | ||
| .inputValueDeprecation(true) | ||
| .typeRefFragmentDepth(7) |
Member
Author
There was a problem hiding this comment.
mostly just reformatting
bbakerman
commented
Aug 10, 2023
| def fField = (queryType['fields'] as List)[0] | ||
| def arg = (fField['args'] as List)[0] | ||
| arg['name'] == "arg" | ||
| arg['defaultValue'] == "null" // printed AST |
Member
Author
There was a problem hiding this comment.
test is here - the introspection AST printed value is "null" and not ""
dondonz
approved these changes
Aug 21, 2023
dondonz
added a commit
that referenced
this pull request
Aug 21, 2023
This was referenced Aug 21, 2023
bbakerman
pushed a commit
that referenced
this pull request
Aug 22, 2023
bbakerman
pushed a commit
that referenced
this pull request
Aug 22, 2023
* Backport null default value https://github.com/graphql-java/graphql-java/pull/3286/files * Fix Javadoc * Add import * Add imports * Another import
dondonz
added a commit
that referenced
this pull request
Aug 31, 2023
deprecated default value method produces bad results (cherry picked from commit a54bb43)
dondonz
added a commit
that referenced
this pull request
Sep 4, 2023
…-fix 21.x Cherry pick pull request #3286
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 fixes the deprecated
defaultValueinput of null values when an AST literal is required - eg in schema printing and introspection.see #3285