From 555e2ac85b7d2d9d9841de66ff47ffe8fcd2065f Mon Sep 17 00:00:00 2001 From: Rob Richard Date: Sun, 12 Jan 2025 06:35:42 -0500 Subject: [PATCH] Make @stream initialCount NonNull (#4322) Updated to reflect spec draft https://github.com/graphql/graphql-spec/pull/1132 Also changed the argument order to match the spec draft --- src/type/directives.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/type/directives.ts b/src/type/directives.ts index a6afb13dbd..6b6f5d4fa2 100644 --- a/src/type/directives.ts +++ b/src/type/directives.ts @@ -204,6 +204,11 @@ export const GraphQLStreamDirective = new GraphQLDirective({ 'Directs the executor to stream plural fields when the `if` argument is true or undefined.', locations: [DirectiveLocation.FIELD], args: { + initialCount: { + default: { value: 0 }, + type: new GraphQLNonNull(GraphQLInt), + description: 'Number of items to return immediately', + }, if: { type: new GraphQLNonNull(GraphQLBoolean), description: 'Stream when true or undefined.', @@ -213,11 +218,6 @@ export const GraphQLStreamDirective = new GraphQLDirective({ type: GraphQLString, description: 'Unique name', }, - initialCount: { - default: { value: 0 }, - type: GraphQLInt, - description: 'Number of items to return immediately', - }, }, });