- Introduction
- Quick start
- Philosophy
- Comparison
- Default behaviors
- Limitations
- Debugging runbook
- FAQ
- Mocking HTTP
- Mocking GraphQL
- Mocking WebSocket
- Integrations
- API
- CLI
- Best practices
- Recipes
Operations
Intercepting any GraphQL operation.
You can intercept any GraphQL operation regardless of its kind by defining a graphql.operation()
handler. Unlike query and mutation handlers, the operation handler does not require you to specify the operation kind or name, only the response resolver.
graphql.operation(() => {})
You can still access all the Response resolver arguments of the intercepted GraphQL operation, like
operationName
,variables
, etc.
This type of interception is handy when you want to delegate the request handling to an external source, like a mocked GraphQL schema. For that, see Schema-first mocking.