MichalLytek / MichalLytek/typegraphql-prisma

Add Support for Renaming Enums

Open
#481 0 comments 0 reactions 0 assignees View on GitHub
community enhancement
Dominant language
TypeScript
Stars
918
Forks
130
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
Rename/change enum names similar to renaming models https://prisma.typegraphql.com/docs/advanced/renaming-model/

**Describe the solution you'd like**
annotate similar to how models are done `/// @@TypeGraphQL.type(name: "newName")`

**Describe alternatives you've considered**
rebuild the enum with the desired name manually

**Additional context**
we have conflicts from legacy declared enums in our app and newer ones we want to use from prisma enum, but when trying to have them both we run into an error

`Error: Schema must contain uniquely named types but contains multiple types named "FooEnumName".`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the existing model-renaming behavior referenced in the TypeGraphQL documentation and the generator's Prisma enum emission path. Implement support for the proposed `/// @@TypeGraphQL.type(name: "newName")` annotation and verify that generated enum names can be changed without duplicate GraphQL type-name errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
backend-api-design, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.