P
Prisma•4w ago
Jay Bell

Prisma.validator is gone but docs still have it and not sure the alternative

Docs: https://www.prisma.io/docs/orm/prisma-client/type-safety/prisma-validator PR that removes it: https://github.com/prisma/prisma/pull/28059 What am I supposed to do now? Is there an alternative, this seems to be a breaking change I cannot find discussed in the release notes: https://github.com/prisma/prisma/releases I upgraded from 6.14.0 to 6.16.0
Prisma validator | Prisma Documentation
The Prisma validator is a utility function that takes a generated type and returns a type-safe object which adheres to the generated types model fields.
GitHub
Releases · prisma/prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB - prisma/prisma
13 Replies
Prisma AI Help
Prisma AI Help•4w ago
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
Nurul
Nurul•4w ago
Thanks for raising this conversation. We should definitely have an alternative for Prisma Validator in docs. We are discussing this internally. Please allow me to get back to you with more information.
Jay Bell
Jay BellOP•4w ago
Thank you Nurul. We use validator extensively so I will need to migrate a lot of places.
Nurul
Nurul•4w ago
I totally understand. We will definitely update docs to provide alternatives. I'll update you as soon as I have more information.
Jay Bell
Jay BellOP•4w ago
Thanks! Enjoy your day
CatNoir
CatNoir•4w ago
i use this a lot in my code too 😔
nikolasburk
nikolasburk•4w ago
Would you be able to use TypeScript's native satisfies keyword as a replacement for it? https://www.prisma.io/blog/satisfies-operator-ur8ys8ccq7zb#infer-prisma-output-types-without-prismavalidator
Prisma
How TypeScript 4.9 satisfies Your Prisma Workflows
Learn how TypeScript 4.9''s new satisfies operator can help you write type-safe code with Prisma
CatNoir
CatNoir•4w ago
oh seems like that will do, thanks!
Jay Bell
Jay BellOP•4w ago
Will need to take a look, will see if I can put together an example. ok that does seem to work, I will just need to figure out when we have time to migrate all of our code. We have 258 usages of validator right now.
goYsticks
goYsticks•3w ago
189 usages over here in 84 files. I wish there was a stop gap I could do to switch to the new ESM generator and not have to refactor the entire application.
Jay Bell
Jay BellOP•3w ago
ya... kind of annoying a breaking change was pushed in a minor.
Arthur
Arthur•3w ago
Same problem here! Very confused on why things broke here, specially when the docs still reference this feature. My solution was to downgrade. I hope a solution is provided in the docs soon

Did you find this page helpful?