-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[typescript-operations] Generate enums referenced in operation Variables #10508
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
Conversation
🦋 Changeset detectedLatest commit: b5a7f27 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
be9829d to
74a7a97
Compare
| describe('TypeScript Operations Plugin - Enum', () => { | ||
| it.todo('does not generate unused enum in variables and result'); | ||
| it.todo('handles native numeric enum correctly'); | ||
| it.todo('handles const enum correctly'); | ||
| it.todo('handles native const enum correctly'); | ||
| it.todo('handles native enum correctly'); | ||
| it.todo('handles EnumValues correctly'); | ||
| // Bring over tests from https://github.com/dotansimha/graphql-code-generator/blob/accdab69106605241933e9d66d64dc7077656f30/packages/plugins/typescript/typescript/tests/typescript.spec.ts | ||
| }); |
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.
These tests will be tested in a follow-up PR. I want to get the logic of detecting used input types into the feature branch first.
Description
This PR adds logic to generate enums in the generated file if used in operations Variables. This uses the enum conversion logic in #10520
This is a breaking change because previous setup with
typescriptplugin will break as both plugins now generate the same enum.Related #10496
Note: there are some unfinished tests. I want to get the "used input types logic detection" into the feature branch first.
Type of change
How Has This Been Tested?