Hooks Example
The Hooks example demonstrates how you can write custom Middleware functions to "hook" into the request lifecycle.
Configuration
If you want to get the full picture of what's possible with hooks, please have a look into the wundergraph.server.ts reference.
In this case, we're keeping it simple and implement a mutatingPostResolve
hook to inject a custom rocket into the response. This hook allows us to modify the response object before it is sent back to the client. We've got access to the client request, the response and the user, so we're pretty flexible in what we can do with it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Learn more
Deploy to WunderGraph Cloud
The easiest way to deploy your WunderGraph app is to use WunderGraph Cloud.