Hey all - is there a method of keeping all enums f...
# prisma-client
o
Hey all - is there a method of keeping all enums from Prisma schema in the output build even if they're unused? I'd prefer defining all my enums in Prisma so I'm not having to do it in multiple places.
1
a
Hey 👋🏾 Prisma Client generates TypeScript enums for the enum values in the Prisma schema, which you can use in any part of your application. Here’s an example:
Copy code
import type { <YourEnumType> } from '@prisma/client'
The TypeScript types are available in your
node_modules
after generating Prisma Client 🙂
o
I’m aware yes - but if an Enum in the schema isn’t used, it's excluded from the generated content
a
Ah, I see what you mean. This seems to be a bug. Could you create a GitHub issue?
m
Hey there, is this your issue? https://github.com/prisma/prisma/issues/13382 or do you have a different use case?
cc @OYΞD
o
Sorry for the delay - it wasn't me, but I've commented on the thread as well - thanks!