I'm trying to do image processing on Node and am using a Prisma GraphQL-Yoga server to manage the queue of jobs. A React/Apollo front end that queues the jobs, that is, it calls a Mutation on the server which stores the jobs in the DB via Prisma. The images are uploaded using multer
, taking advantage of the fact that the GraphQL-Yoga server exposes the Express server underneath with server.express
-- I'm assuming that it is OK to use the GraphQL-Yoga server as a regular Express/Node server when I need to.
My question is: how do I change the status of the jobs to completed
in my database when each job is done? I can access prisma
directly, of course, as I do in my resolvers, but I was thinking it might be more elegant to use a Mutation, that is, keep all accesses to the DB using GraphQL. As said, I'm using Apollo from the React front end. Can I 'call' a Mutation from the backend? How might I do that?
Thanks for any insights! I'm new to GraphQL and sometimes missing the forest for the trees...