You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `@defer` and `@stream` directives are not enabled by default. In order to use these directives, you must add them to your GraphQL Schema.
7
+
8
+
```js
9
+
import {
10
+
GraphQLSchema,
11
+
GraphQLDeferDirective,
12
+
GraphQLStreamDirective,
13
+
specifiedDirectives,
14
+
} from'graphql';
15
+
16
+
constschema=newGraphQLSchema({
17
+
query,
18
+
directives: [
19
+
...specifiedDirectives,
20
+
GraphQLDeferDirective,
21
+
GraphQLStreamDirective,
22
+
],
23
+
});
24
+
```
25
+
26
+
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 commit comments