Skip to content

Commit

Permalink
Add docs for responseForOperation
Browse files Browse the repository at this point in the history
  • Loading branch information
nwalters512 authored and abernix committed Dec 30, 2019
1 parent 7da104c commit 3b2e421
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/source/integrations/plugins.md
Expand Up @@ -335,6 +335,22 @@ didResolveOperation?(
): ValueOrPromise<void>;
```

### `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<TContext>,
'metrics' | 'source' | 'document' | 'operationName' | 'operation'
>,
): ValueOrPromise<GraphQLResponse | null>;
```

### `executionDidStart`

The `executionDidStart` event fires whenever Apollo Server begins executing the
Expand Down

0 comments on commit 3b2e421

Please sign in to comment.