Skip to content

Conversation

@eddeee888
Copy link
Collaborator

Description

We need to be able to generate enum from typescript-operations the same way typescript plugin does.

This PR extracts the following functions to @graphql-codegen/vistitor-plugin-common so we can re-use them:

  • convertSchemaEnumToDeclarationBlockString: previously the main logic to convert GraphQL enum -> TypeScript enum in typescript visitor.
  • getNodeComment: previously built into BaseTypeVisitor as a method, this is now a utility function

Related #10496

Type of change

Please delete options that are not relevant.

  • Refactor

How Has This Been Tested?

  • Unit test

@changeset-bot
Copy link

changeset-bot bot commented Nov 24, 2025

🦋 Changeset detected

Latest commit: 57e46c2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@graphql-codegen/visitor-plugin-common Major
@graphql-codegen/typescript Patch
@graphql-codegen/typescript-document-nodes Patch
@graphql-codegen/gql-tag-operations Patch
@graphql-codegen/typescript-operations Patch
@graphql-codegen/typescript-resolvers Patch
@graphql-codegen/typed-document-node Patch
@graphql-codegen/introspection Patch
@graphql-codegen/client-preset Patch
@graphql-codegen/graphql-modules-preset Patch

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

@eddeee888 eddeee888 force-pushed the extract-enum-utility branch from 90a0c5a to ded23c1 Compare November 24, 2025 14:24
@eddeee888 eddeee888 marked this pull request as ready for review November 25, 2025 12:30
@eddeee888 eddeee888 merged commit 8babe46 into master-next Nov 25, 2025
16 checks passed
@eddeee888 eddeee888 deleted the extract-enum-utility branch November 25, 2025 12:32
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

Successfully merging this pull request may close these issues.

2 participants