Replies: 3 comments 7 replies
-
Hi @ArkasDev 👋 Did you run Also, to use enums, you can import it and use it as shown below: import { PrismaClient, BlogStateType } from '@prisma/client';
const prisma = new PrismaClient();
const blog = await prisma.blog.create({
data:{
blogType: BlogStateType.generated
}
}); This should now create the record in the database as shown with this output: { id: '64d0a00703518e92e151013e', blogType: 'generated' } If this answers your question, it would be great if you could mark this Discussion as answered to indicate that it has been resolved. Otherwise please let us know how else we can help you further or close the Discussion if it was resolved in some other way 🙏 |
Beta Was this translation helpful? Give feedback.
-
i got the same Error today - im using a lot of Prisma Enums right now, but the one i created today -> is undefined.... is there any solution or hint why this happens? |
Beta Was this translation helpful? Give feedback.
-
any update on this? |
Beta Was this translation helpful? Give feedback.
-
Bug description
I would like to use enums in my Prisma model. Unfortunately, I get an error when I want to access the enum. I already run Prisma generation, there is no import issue.
How to reproduce
schema.prisma
tsconfig.json
Expected behavior
No response
Prisma information
// Add your schema.prisma
// Add your code using Prisma Client
Environment & setup
macOS
MongoDB
Node 18.16.0
Prisma Version
"@prisma/client": "^5.1.1"
Beta Was this translation helpful? Give feedback.
All reactions