-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fix bug when NullValue is nested inside ObjectValue #91
Conversation
parsedValue = null; | ||
} else { | ||
parsedValue = parseLiteral(fld.getValue(), variables); | ||
} | ||
parsedValues.put(fld.getName(), parsedValue); |
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 overall Object value is guaranteed not to be NullValue
as this is handled earlier in GraphQL Java, however it may contain a nested NullValue
.
@@ -54,7 +54,6 @@ public Object parseValue(Object input) throws CoercingParseValueException { | |||
@Override | |||
public Object parseLiteral(Object input) throws CoercingParseLiteralException { | |||
// on purpose - object scalars can be null | |||
//noinspection ConstantConditions |
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.
IDE said this is redundant
|
||
mkObjectValue([ | ||
field1: mkNullValue() | ||
] as Map<String, Value>) | [field1: null] // Nested NullValue inside ObjectValue |
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.
This test fails with the old behaviour, and passes with the new behaviour
Fixes #90, thanks @Kingson-de for reporting!
Enables
NullValue
to be nested insideObjectValue
.