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 {
6363 GraphQLIncludeDirective ,
6464 GraphQLSkipDirective ,
6565 GraphQLDeferDirective ,
66+ GraphQLStreamDirective ,
6667 GraphQLDeprecatedDirective ,
6768 GraphQLSpecifiedByDirective ,
6869 // "Enum" of Type Kinds
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import {
1818 defineArguments ,
1919 GraphQLNonNull ,
2020} from './definition' ;
21- import { GraphQLBoolean , GraphQLString } from './scalars' ;
21+ import { GraphQLBoolean , GraphQLInt , GraphQLString } from './scalars' ;
2222
2323/**
2424 * Test if the given value is a GraphQL directive.
@@ -188,6 +188,31 @@ export const GraphQLDeferDirective = new GraphQLDirective({
188188 } ,
189189} ) ;
190190
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+
191216/**
192217 * Constant string used for default reason for a deprecation.
193218 */
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ export {
132132 GraphQLIncludeDirective ,
133133 GraphQLSkipDirective ,
134134 GraphQLDeferDirective ,
135+ GraphQLStreamDirective ,
135136 GraphQLDeprecatedDirective ,
136137 GraphQLSpecifiedByDirective ,
137138 // Constant Deprecation Reason
You can’t perform that action at this time.
0 commit comments