File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ export {
63
63
GraphQLIncludeDirective ,
64
64
GraphQLSkipDirective ,
65
65
GraphQLDeferDirective ,
66
+ GraphQLStreamDirective ,
66
67
GraphQLDeprecatedDirective ,
67
68
GraphQLSpecifiedByDirective ,
68
69
// "Enum" of Type Kinds
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {
16
16
defineArguments ,
17
17
GraphQLNonNull ,
18
18
} from './definition' ;
19
- import { GraphQLBoolean , GraphQLString } from './scalars' ;
19
+ import { GraphQLBoolean , GraphQLInt , GraphQLString } from './scalars' ;
20
20
21
21
/**
22
22
* Test if the given value is a GraphQL directive.
@@ -176,6 +176,31 @@ export const GraphQLDeferDirective = new GraphQLDirective({
176
176
} ,
177
177
} ) ;
178
178
179
+ /**
180
+ * Used to conditionally stream list fields.
181
+ */
182
+ export const GraphQLStreamDirective = new GraphQLDirective ( {
183
+ name : 'stream' ,
184
+ description :
185
+ 'Directs the executor to stream plural fields when the `if` argument is true or undefined.' ,
186
+ locations : [ DirectiveLocation . FIELD ] ,
187
+ args : {
188
+ if : {
189
+ type : GraphQLBoolean ,
190
+ description : 'Stream when true or undefined.' ,
191
+ } ,
192
+ label : {
193
+ type : GraphQLString ,
194
+ description : 'Unique name' ,
195
+ } ,
196
+ initialCount : {
197
+ defaultValue : 0 ,
198
+ type : GraphQLInt ,
199
+ description : 'Number of items to return immediately' ,
200
+ } ,
201
+ } ,
202
+ } ) ;
203
+
179
204
/**
180
205
* Constant string used for default reason for a deprecation.
181
206
*/
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ export {
134
134
GraphQLIncludeDirective ,
135
135
GraphQLSkipDirective ,
136
136
GraphQLDeferDirective ,
137
+ GraphQLStreamDirective ,
137
138
GraphQLDeprecatedDirective ,
138
139
GraphQLSpecifiedByDirective ,
139
140
// Constant Deprecation Reason
You can’t perform that action at this time.
0 commit comments