I'd like to create something like a stored procedu...
# prisma-whats-new
c
I'd like to create something like a stored procedure - data in one type gets updated / added, this kicks off a job that does a couple queries, averages out a value, updates the field in another type. Is a server side subscription what i want here? And if it is, is there a guide/tutorial to walk me through it because i'm an idiot? 😄
n
yes, a SSS is what you want here 😛
the general concept of a SSS is explained here: https://www.graph.cool/docs/tutorials/welcome-email-with-sss-dee0aethoo/
you'd need to use
graphql-request
to do the queries yourself
c
ah, so you create the trigger and then write javascript to make your updates, and use graphql-request to do any further queries / mutations ?
n
indeed