wundergraph.server.ts reference

Here's an overview of all the different options to extend your WunderGraph Server using custom hooks and custom GraphQL resolvers.

webhooks

Configures your custom webhook endpoints.

preResolve hook

This hook is called BEFORE on Operation is resolved.

mutatingPreResolve hook

This hook is called BEFORE an operation is resolved, it can manipulate the input.

postResolve hook

This hook is called AFTER the operation is resolved.

mutatingPostResolve hook

This hook is called AFTER the operation is resolved and can be used to manipulate the response.

mockResolve hook

Return mock data instead of calling the real resolver.

customResolve hook

Skip the original resolver and fully replace it.

onOriginRequest hook

Customize all requests before they get sent to an origin.

onOriginResponse hook

Customize all responses after they come back from an origin.

onWsConnectionInit hook

Customize ws connection init message payload.

postAuthentication hook

This hook is called AFTER the authentication flow is complete.

revalidate hook

This hook is called when the user calls the user endpoint with the revalidate option.

mutatingPostAuthentication hook

This hook can be used to manipulate the user object AFTER the authentication flow is complete.

postLogout hook

This hook is called AFTER the user is logged out.

Custom GraphQL Servers

Write custom GraphQL servers/resolvers to extend your Virtual Graph.

Context factory

Extend the WunderGraph server context.

Was this article helpful to you?
Provide feedback

Edit this page