My goal is to run some kind of webhook, cloud function or say I want to perform some kind of action after each query success or mutation success in graphql. Means I want to log each and every action performed by users (kind of history of when what was created and updated). How can this be implemented using some kind of middleware between graphql and DB (say mongo for now)? Means that middleware should be responsible to run the logging action each time a query or mutation is called from front-end.
Tech stack being used is- Node, express, graphQl, Redis etc.
Any suggestions would really be appreciated. Thanks
The solution I came up with was calling a function manually each time a query or mutate.