Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression w.r.t. aliases and conditional inline fragments in @graphql-codegen/visitor-plugin-common@5.1.0 #9898

Open
aboks opened this issue Mar 13, 2024 · 0 comments

Comments

@aboks
Copy link

aboks commented Mar 13, 2024

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 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.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • NodeJS: 18.17.1
  • graphql version: 16.8.1
  • @graphql-codegen/visitor-plugin-common version: 5.1.0

Codegen Config File

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant