P
Prisma•5mo ago
DollarNavalex

Import Enum from my TS to the schema

Hey, Wanted to know if it's possible to import an enum inside my schema.prisma file instead of defining it inside ? Because all my types used by both front & back are located to a dedicated package, and it actually force me to define my enum in 2 distinct places, where I would like to only have it in my types package. Thanks!
1 Reply
RaphaelEtim
RaphaelEtim•5mo ago
Hi @DollarNavalex 👋 Prisma does not support importing enums directly into the schema.prisma file from external packages or files. Enums need to be defined within the Prisma schema file itself. This limitation means that you have to define your enums in two distinct places if you want to use them both in your Prisma schema and in other parts of your application.
Want results from more Discord servers?
Add your server