Problem with mapped enums in 7.0.0?
I have a mapped enum in my schema, something along the lines of:
And a create request for it in a test:
I'm getting the following error:
If you have any insight I would appreciate it.
4 Replies
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the
#ask-ai channel awaits if you're curious!Was this working as expected in Prisma 6?
I'll need to reproduce this and see what's the issue
Looks like there's a few people (including myself) reporting the issue.
The current workaround is passing the "key value" of the ENUM into the methods instead of the ENUM themselves - E.g. in the above, passing the string literal
"PENDING" in, instead of SuggestionStatus.PENDING works.
https://github.com/prisma/prisma/issues/28591GitHub
Mapped enums with create function seem to not work correctly · Iss...
Bug description I have a mapped enum in my schema, something along the lines of: enum SuggestionStatus { PENDING @map("pending") ACCEPTED @map("accepted") REJECTED @map("re...
I've just about finished the migration to v7 and i stumbled onto this enum ripper.. This is blocking us from moving forward with the upgrade. Yes this was working in Prisma 6