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
In client extensions there's a transaction example:
constprisma=newPrismaClient().$extends({query: {user: {// Get the input `args` and a callback to `query`asyncfindFirst({ args, query, operation }){const[result]=awaitprisma.$transaction([query(args)])// wrap the query in a batch transaction, and destructure the result to return an arrayreturnresult// return the first result found in the array},},},})
But the inner await prisma.$transaction is not defined because we are just now defining the prisma variable (const prisma = new PrismaClient().$extends({ ...)
So this example is broken
The text was updated successfully, but these errors were encountered:
In client extensions there's a transaction example:
Reference: https://www.prisma.io/docs/orm/prisma-client/client-extensions/query#wrap-a-query-into-a-batch-transaction
But the inner
await prisma.$transaction
is not defined because we are just now defining theprisma
variable (const prisma = new PrismaClient().$extends({ ...
)So this example is broken
The text was updated successfully, but these errors were encountered: