I would like to register post and pre hooks before and after some of my mutations, right in the UI. Calling custom pre-hooks is a pain right now, and requires a lot of unnecessary calls as you need to treat Apollo queries and pre-hooked mutations differently. This is a key feature to me. Custom constraints would only solve partially the issue
Current use case: user creates an entity of which this user should be set as owner. This owner property could be set automatically instead of the user setting it explicitly in the mutation from the client.
It's now possible to fully control the request pipeline of a mutation: https://www.graph.cool/docs/reference/functions/request-pipeline/overview-pa6guruhaf/
Here are examples: https://github.com/graphcool-examples/functions
@altschuler's comment is best discussed here: #219.
Hello, I don麓t exactly get how this would work with prisma?
@marktani comment is purely related to graphcool isn麓t it?
We support some hooks in prisma as well: https://www.prisma.io/docs/prisma-cli-and-configuration/prisma-yml-5cy7/#hooks-optional
But you can invoke webhooks in your application server as well if this doesn't fit your use case.
Most helpful comment
Current use case: user creates an entity of which this user should be set as owner. This owner property could be set automatically instead of the user setting it explicitly in the mutation from the client.