diff --git a/docs/source/integrations/plugins.md b/docs/source/integrations/plugins.md index 27155b3a543..b6d1525901a 100644 --- a/docs/source/integrations/plugins.md +++ b/docs/source/integrations/plugins.md @@ -335,6 +335,22 @@ didResolveOperation?( ): ValueOrPromise; ``` +### `responseForOperation` + +The `responseForOperation` event is fired immediately before GraphQL execution +would take place. If its return value resolves to a non-null `GraphQLResponse`, +that result is used instead of executing the query. Hooks from different plugins +are invoked in series and the first non-null response is used. + +```typescript +responseForOperation?( + requestContext: WithRequired< + GraphQLRequestContext, + 'metrics' | 'source' | 'document' | 'operationName' | 'operation' + >, +): ValueOrPromise; +``` + ### `executionDidStart` The `executionDidStart` event fires whenever Apollo Server begins executing the