-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: reduce code output of client preset #10073
Conversation
🦋 Changeset detectedLatest commit: bdd83b3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
💻 Website PreviewThe latest changes are available as preview in: https://6b03ddc3.graphql-code-generator.pages.dev |
bd811eb
to
0e7e51f
Compare
bcb1bf8
to
e57eefd
Compare
packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
Released @graphql-codegen/client-preset@4.4.0 |
This is a massive breaking change, upgrading from |
Even undoing the patch locally results in the generated file being broken:
|
Breaking my app also because I was actually using those types! @n1ru4l do you know how we can get the original behaviour back? I can see |
Same for the app I am working on - we relied on these types. I've tried adding onlyEnumTypes: false,
onlyOperationTypes: false, to the configuration hoping it will 'revert' the current defaults to the previous ones, but it seems not having any effect... |
Filed as #10167 |
PR #10155 adds |
This reverts commit 8471a18.
We don't need all these types for the GraphQL schema for client preset. I added an option to omit them within
@graphql-codegen/visitor-plugin-common
and@graphql-codegen/typescript
and enabled this option by default for the client preset.For GraphQL Hive this reduces the generated code for the client preset by over 50%. Also, see the diff and removed code here from the fixtures/examples. :D
We could even reduce generated enums and scalars to only those used within the provided graphql documents. However, let's keep that for another time.