You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
allow Coercing.parseLiteral to return null (remove @NonNull annotation) #2904
sorry to open it again, but the implementation of ObjectScalar is actually wrong: we never pass in NullValue (it is automatically converted to Java null).
On the follow up discussion - the NullValue case in ObjectScalar's parseLiteral implementation has been removed, as a NullValue literal input will coerced as null & returned before the scalar's parseLiteral method is called. Added more documentation to make this clearer inside Coercing.
Activity
bbakerman commentedon Aug 3, 2022
Hmm this is an intersting one - on the one hand the code is like that to say
CoercingParseLiteralExceptionif there is a problem in the conversionI guess that the AST
NullValueis mostly like going to result in a scalr saying its raw value for that is nullsgerke-1L commentedon Aug 5, 2022
I found this previous discussion: #1362
Somehow the
@NonNullwas removed from serialize but not from parseLiteral.bbakerman commentedon Aug 24, 2022
This has been fixed
sgerke-1L commentedon Aug 25, 2022
Thanks for addressing this with #2912
andimarek commentedon Aug 26, 2022
sorry to open it again, but the implementation of
ObjectScalaris actually wrong: we never pass inNullValue(it is automatically converted to Javanull).andimarek commentedon Aug 26, 2022
@sgerke-1L can you explain why you would want to return
nullfor not null literal value? thankssgerke-1L commentedon Aug 26, 2022
Motivation was the handling of
NullValuein ObjectScalar. The null return was causing problems with spotbugs validation.sgerke-1L commentedon Aug 26, 2022
Is it easy to see that NullValue is never passed?
andimarek commentedon Aug 26, 2022
Not sure what you mean with easy: if you look into the GraphQL Java source code you can find it.
It should be clearly documented I would say.
dondonz commentedon Aug 30, 2022
On the follow up discussion - the
NullValuecase inObjectScalar'sparseLiteralimplementation has been removed, as aNullValueliteral input will coerced as null & returned before the scalar'sparseLiteralmethod is called. Added more documentation to make this clearer insideCoercing.sgerke-1L commentedon Sep 7, 2022
Thanks, this solves our problem: The inconsistency now resolved.