Fix const enum type prefix/suffix misconfiguration#10781
Conversation
🦋 Changeset detectedLatest commit: 3452f12 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 |
const enum type prefix/suffix misconfiguration
| validateTs(result, undefined, undefined, undefined, undefined, true); | ||
| }); | ||
|
|
||
| it('handles `native-numeric` enum with types prefix and suffix', async () => { |
There was a problem hiding this comment.
Added this test to ensure the behaviour is captured, even if it's not related to this PR
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-codegen/visitor-plugin-common |
7.0.1-alpha-20260506131057-3452f127737a96e67180eff01da10092b2c5bad0 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-operations |
6.0.1-alpha-20260506131057-3452f127737a96e67180eff01da10092b2c5bad0 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript |
6.0.1-alpha-20260506131057-3452f127737a96e67180eff01da10092b2c5bad0 |
npm ↗︎ unpkg ↗︎ |
| Admin_ZZ = 0, | ||
| Customer_ZZ = 1 |
There was a problem hiding this comment.
Currently, the typesPrefix is not applied to enumValues e.g. this is Admin_ZZ and not AA_Admin_ZZ
I remember this is the previous behaviour. So I'm adding test here to be explicit to capture the current behaviour
(especially when it feels wrong, and should be fixed )
💻 Website PreviewThe latest changes are available as preview in: https://pr-10781.graphql-code-generator.pages.dev |
Description
This is a bug that happened during the refactoring enum prefix/suffix when
typesPrefixandtypesSuffixis used withenumType=constspecifically. In this case,typesPrefixis accidentally used in thetypesSuffixslot.This PR fixes the issue and add tests for relevant cases.
Related #10776
Type of change