hey guys, i made a mutation callback on the site a...
# prisma-whats-new
a
hey guys, i made a mutation callback on the site and put this in my server code. `` server.post('/', (req, res) => { // new customer webhook const newCustomer = { firstName: req.body.createdNode.firstName, lastName: req.body.createdNode.lastName, email: req.body.createdNode.email, address: req.body.createdNode.address, addressCity: req.body.createdNode.addressCity, addressState: req.body.createdNode.addressState, addressZip: req.body.createdNode.addressZip, }`` .... How do I get react to listen and display a notification that the operation was successful though?
n
@akadop you could either use a GraphQL subscription, or simply check it say every second
with a query
a
So the mutation callback itself doesn't allow me to dispatch an action onto the client?
What would a subscription look like in this case? Am I subscribing to createNode?
n
you can read how our subscriptions are structured here: https://www.graph.cool/docs/reference/simple-api/generated-subscriptions-aip7oojeiv/
it will be a
Customer
query with a
mutation_in: [CREATED]
argument
a
got it, thank you
So I don't actually need to post the callback onto my server in this instance, I could just create a subscription and use a callback mutation -> zapier -> email
n
I am not quite following - what is it that you want to do in the end?