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
With of @graphql-codegen/visitor-plugin-common@5.1.0, is seems that when an aliased object field and a conditional inline fragment are used side-by-side in a query, the aliased object field is made optional, instead of the fields in the conditional inline fragment. My guess would be that this is caused by the changes in #9842.
See the schema.graphql and document.graphql in the provided code sandbox. Observe the types.ts obtained by running graphql-codegen. In the UserQuery type, the email property of user is not optional, but addressAlias is optional.
Expected behavior
I would expect email to be optional and addressAlias to be not optional.
Which packages are impacted by your issue?
@graphql-codegen/visitor-plugin-common
Describe the bug
With of
@graphql-codegen/visitor-plugin-common@5.1.0
, is seems that when an aliased object field and a conditional inline fragment are used side-by-side in a query, the aliased object field is made optional, instead of the fields in the conditional inline fragment. My guess would be that this is caused by the changes in #9842.Your Example Website or App
https://codesandbox.io/p/devbox/quirky-minsky-qllmxx
Steps to Reproduce the Bug or Issue
See the
schema.graphql
anddocument.graphql
in the provided code sandbox. Observe thetypes.ts
obtained by runninggraphql-codegen
. In theUserQuery
type, theemail
property ofuser
is not optional, butaddressAlias
is optional.Expected behavior
I would expect
email
to be optional andaddressAlias
to be not optional.Screenshots or Videos
No response
Platform
graphql
version: 16.8.1@graphql-codegen/visitor-plugin-common
version: 5.1.0Codegen Config File
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: