-
Notifications
You must be signed in to change notification settings - Fork 1.2k
deprecated default value method produces bad results #3286
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
Conversation
| // 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; |
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.
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.
| .directiveIsRepeatable(true) | ||
| .schemaDescription(true) | ||
| .inputValueDeprecation(true) | ||
| .typeRefFragmentDepth(7) |
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.
mostly just reformatting
| def fField = (queryType['fields'] as List)[0] | ||
| def arg = (fField['args'] as List)[0] | ||
| arg['name'] == "arg" | ||
| arg['defaultValue'] == "null" // printed AST |
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.
test is here - the introspection AST printed value is "null" and not ""
* Backport null default value https://github.com/graphql-java/graphql-java/pull/3286/files * Fix Javadoc * Add import * Add imports * Another import
deprecated default value method produces bad results (cherry picked from commit a54bb43)
…-fix 21.x Cherry pick pull request #3286
This fixes the deprecated
defaultValueinput of null values when an AST literal is required - eg in schema printing and introspection.see #3285