You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users can't do this with the existing Wasp setup since there is no way for them to give Wasp a new Prisma client to use throughout the app.
That's why having a Prisma setup hook that could influence which Prisma client instance Wasp uses is useful.
Implementation
It would probably be a db.prismaSetup hook whose implementation could look like this:
exportfunctionsetupPrisma(prisma: PrismaClient): PrismaClient{// An example from Prisma docsreturnprisma.$extends({query: {user: {asyncfindMany({ model, operation, args, query }){// take incoming `where` and set `age`args.where={ ...args.where,age: {gt: 18}}returnquery(args)},},},})}// Somewhere in the codebaseawaitprisma.user.findMany()// returns users whose age is greater than 18
The text was updated successfully, but these errors were encountered:
Prisma supports client extensions: https://www.prisma.io/docs/orm/prisma-client/client-extensions which for:
Users can't do this with the existing Wasp setup since there is no way for them to give Wasp a new Prisma client to use throughout the app.
That's why having a Prisma setup hook that could influence which Prisma client instance Wasp uses is useful.
Implementation
It would probably be a
db.prismaSetup
hook whose implementation could look like this:The text was updated successfully, but these errors were encountered: