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
TL;DR: I think that the implementation of this generator misinterprets the semantics of lists in GraphQL. It generates Collection<T> where it should generate List<T>.
There's mismatch in what classes generated by the library are expected to provide (lists) and what they actually provide (collections).
Steps to Reproduce
Generate code for
typeFoo { bar: [String] }
Expected Result
The Java equivalent of bar should have type List<String>, and this should of course generalize.
Actual Result
The Java equivalent of bar has type Collection<String>.
@lorenzleutgeb thanks for finding and fixing this!
It's good that I haven't released 2.0.0 yet (planned to do it yesterday, but did not have time). Hopefully will do today if someone will review 179 (maybe you could?)
TL;DR: I think that the implementation of this generator misinterprets the semantics of lists in GraphQL. It generates
Collection<T>
where it should generateList<T>
.There's mismatch in what classes generated by the library are expected to provide (lists) and what they actually provide (collections).
Steps to Reproduce
Generate code for
Expected Result
The Java equivalent of
bar
should have typeList<String>
, and this should of course generalize.Actual Result
The Java equivalent of
bar
has typeCollection<String>
.Additional context
Semantics of Lists in GraphQL
The GraphQL specification (draft) considers a list to be
(emphasis mine) which clearly references ordering of elements as a characteristic property of values of the list type.
Also there is other tooling out there, like Hasura which clearly rely on the property of lists being ordered.
Semantics of Lists in this generator
The
Collection
type in Java, however, does not guarantee ordering of elements (considerHashSet
as a counterexample).The text was updated successfully, but these errors were encountered: