Matheus Assis
05/28/2020, 1:37 PM@nexus/schema
, to "intercept" every time an update is done to the database? I'm looking at how to implement algolia, and looks like I have to call an sdk to push to them.
Is there a way of "listening" when changes are done to the database by prisma+nexus? Or adding a callback for every prisma or nexus call? Something to "hook" that?Ryan
05/28/2020, 2:00 PMMatheus Assis
05/28/2020, 2:51 PMRyan
05/29/2020, 6:53 AMresolve(_parent, args, ctx) {
await prisma.somethings.update();
// fire an event here and you can watch for that event someplace else.
}
anotherFn() {
// this function listens for the event and captures that
// and add the business logic required here
}
This would personally be my approach to do this 🙂Matheus Assis
05/29/2020, 11:48 AM