Skip to content

Commit

Permalink
update incremental docs (#3731)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR authored Sep 14, 2022
1 parent b9a2695 commit a358757
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion website/docs/tutorials/defer-stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Enabling Defer & Stream
sidebar_label: Enabling Defer & Stream
---

The `@defer` and `@stream` directives are not enabled by default. In order to use these directives, you must add them to your GraphQL Schema.
The `@defer` and `@stream` directives are not enabled by default. In order to use these directives, you must add them to your GraphQL Schema and use the `experimentalExecuteIncrementally` function instead of `execute`.

```js
import {
Expand All @@ -21,6 +21,11 @@ const schema = new GraphQLSchema({
GraphQLStreamDirective,
],
});

const result = experimentalExecuteIncrementally({
schema,
document,
});
```

If the `directives` option is passed to `GraphQLSchema`, the default directives will not be included. `specifiedDirectives` must be passed to ensure all standard directives are added in addition to `defer` & `stream`.

0 comments on commit a358757

Please sign in to comment.