Sascha Ormanns
06/10/2021, 8:16 AMMiddlewares act as query-level lifecycle hooks, which allow you to perform an action before or after a query runs.When running a nested write or update query, is there any chance to get the result of all the queries/statements executed? Or am I on a prisma-client-function-level when in a Middleware and the result is the result returned from that client call? Something like
prisma.user.create({
data: {
email: '<mailto:elsa@prisma.io|elsa@prisma.io>',
name: 'Elsa Prisma',
posts: {
create: [{ title: 'How to make an omelette' }, { title: 'How to eat an omelette' }],
},
},
include: {
posts: true, // Include all posts in the returned object
},
})janpio
next() function call will split this apart into the individual bits, do the magic, and then return all the data.janpio
Sascha Ormanns
06/10/2021, 9:47 AMjanpio
Sascha Ormanns
06/10/2021, 9:58 AMupdate to the user and within that update an post gets updated too. I would like to get that updated Post for further processing. Ideally it would be possible to retrieve changesets on/after operations