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
Scalars.GraphQLID#serialize should support serialization of Long #313
My underlying object which I am exposing via graphql-java has identifier of type Long.
The object is loaded correctly but when the results are returned, id is omitted.
This happens because of the following lines in Scalars.java:171-178
if (input instanceof String) {
return input;
}
if (input instanceof Integer) {
return String.valueOf(input);
}
return null;
Would it not make sense to add handling for Long type here? Thank you!
As in its the graphql "server" implementations choice. However it does say that errors should be raised if an input is not acceptable rather than null being generated.
I think graphql-java should be more lenient on ID types in this case
Activity
bbakerman commentedon Feb 1, 2017
I agree - I think it might be better as something like
The toString() of an object is a valid identifier in the absence of any other "interface" to say otherwise
bbakerman commentedon Feb 1, 2017
The spec is ambiguous about this
http://facebook.github.io/graphql/#sec-ID
As in its the graphql "server" implementations choice. However it does say that errors should be raised if an input is not acceptable rather than null being generated.
I think graphql-java should be more lenient on ID types in this case
andimarek commentedon Jun 5, 2017
That we produce an Error instead of null is fixed with #455 (and further modified with #487 )
bbakerman commentedon Jun 18, 2017
A PR for this has been merged
bbakerman commentedon Jun 18, 2017
#511