-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87a533f
commit 271e438
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
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. | ||
|
||
```js | ||
import { | ||
GraphQLSchema, | ||
GraphQLDeferDirective, | ||
GraphQLStreamDirective, | ||
specifiedDirectives, | ||
} from 'graphql'; | ||
|
||
const schema = new GraphQLSchema({ | ||
query, | ||
directives: [ | ||
...specifiedDirectives, | ||
GraphQLDeferDirective, | ||
GraphQLStreamDirective, | ||
], | ||
}); | ||
``` | ||
|
||
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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters