smallrye-graphql icon indicating copy to clipboard operation
smallrye-graphql copied to clipboard

[Server] Generics: @NonNull Ignored for Generic List Element

Open schulzp opened this issue 2 years ago • 4 comments

Hi!

Thank you for this amazing project! I've been using it in production for a while now. 😄

I stumbled upon a potential bug:

  • 🟢 @NonNull List<@NonNull String> list; correctly maps to list: [String!]!.
  • 🐛 @NonNull List<@NonNull CustomGeneric<String>> list; maps to list: [CustomGeneric_String]! (list elements are no longer null-safe im schema).
  • ⚠️ @NonNull List<@NonNull CustomGeneric<@NonNull String>> list; maps to list: [CustomGeneric_String!]!, however.

Please see my M(N)WE: https://github.com/schulzp/smallrye-graphql-generics

schulzp avatar Jul 07 '22 09:07 schulzp

Thanks for this. We will have a look a.s.a.p.

phillip-kruger avatar Jul 08 '22 00:07 phillip-kruger

@jmartisk how is your availability to look at this ?

phillip-kruger avatar Jul 10 '22 23:07 phillip-kruger

I wonder if this is related ? #1366

phillip-kruger avatar Jul 20 '22 00:07 phillip-kruger

I remember fixing the client-side counterpart of this just before leaving on PTO. I don't have much insight into how the server side handles generics, I didn't write that relevant code, so I hoped somebody else would step in :) I can put it on my TODO if nobody else wants it, but I have quite a backlog right now.

jmartisk avatar Jul 25 '22 08:07 jmartisk