This example demonstrates how to use the mutatingPostResolve
hook to change the response of the Dragons
operation. Hooks are the type-safe way to write custom middleware functions. If you need an overview about all possible hooks, please refer to the WunderGraph Hooks documentation.
- Copy the
.env.example
file to.env
and fill in the required values. - Install the dependencies and run the complete example in one command:
npm install && npm start
After npm start
has been executed, your browser should open a new tab and navigate to http://localhost:9991/operations/Dragons
. In the console, you can see logs emitted by the mutatingPostResolve
hook.
curl -N http://localhost:9991/operations/users/get?id=1
Read the Docs.
Join us on Discord!