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
Why doesn't the GqlUserQuery just use the already generated GqlUser type and instead creates a new type?
The issue with this is, that all the fields in the query are defined as being undefined-able - when the GqlUser type only allows for null values - Which breaks all code that uses the GqlUser type when handling the result of the GqlUserQuery (because the fields of the types don't match)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following GraphQL Schema:
And this query
Now when I let the codegen run, this is what is generated:
Why doesn't the
GqlUserQuery
just use the already generatedGqlUser
type and instead creates a new type?The issue with this is, that all the fields in the query are defined as being
undefined
-able - when the GqlUser type only allows fornull
values - Which breaks all code that uses theGqlUser
type when handling the result of theGqlUserQuery
(because the fields of the types don't match)Beta Was this translation helpful? Give feedback.
All reactions