diff --git a/website/docs/tutorials/defer-stream.md b/website/docs/tutorials/defer-stream.md index 5235cab4fd..7f1c9ceb95 100644 --- a/website/docs/tutorials/defer-stream.md +++ b/website/docs/tutorials/defer-stream.md @@ -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 { @@ -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`.