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 @@ -18,7 +18,7 @@ import {
18
18
defineArguments ,
19
19
GraphQLNonNull ,
20
20
} from './definition' ;
21
- import { GraphQLBoolean , GraphQLString } from './scalars' ;
21
+ import { GraphQLBoolean , GraphQLInt , GraphQLString } from './scalars' ;
22
22
23
23
/**
24
24
* Test if the given value is a GraphQL directive.
@@ -188,6 +188,31 @@ export const GraphQLDeferDirective = new GraphQLDirective({
188
188
} ,
189
189
} ) ;
190
190
191
+ /**
192
+ * Used to conditionally stream list fields.
193
+ */
194
+ export const GraphQLStreamDirective = new GraphQLDirective ( {
195
+ name : 'stream' ,
196
+ description :
197
+ 'Directs the executor to stream plural fields when the `if` argument is true or undefined.' ,
198
+ locations : [ DirectiveLocation . FIELD ] ,
199
+ args : {
200
+ if : {
201
+ type : GraphQLBoolean ,
202
+ description : 'Stream when true or undefined.' ,
203
+ } ,
204
+ label : {
205
+ type : GraphQLString ,
206
+ description : 'Unique name' ,
207
+ } ,
208
+ initialCount : {
209
+ defaultValue : 0 ,
210
+ type : GraphQLInt ,
211
+ description : 'Number of items to return immediately' ,
212
+ } ,
213
+ } ,
214
+ } ) ;
215
+
191
216
/**
192
217
* Constant string used for default reason for a deprecation.
193
218
*/
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ export {
132
132
GraphQLIncludeDirective ,
133
133
GraphQLSkipDirective ,
134
134
GraphQLDeferDirective ,
135
+ GraphQLStreamDirective ,
135
136
GraphQLDeprecatedDirective ,
136
137
GraphQLSpecifiedByDirective ,
137
138
// Constant Deprecation Reason
You can’t perform that action at this time.
0 commit comments