File tree Expand file tree Collapse file tree 1 file changed +38
-1
lines changed
Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ import {
4242 GraphQLIncludeDirective ,
4343 GraphQLSkipDirective ,
4444 GraphQLDeferDirective ,
45+ GraphQLStreamDirective ,
4546} from '../type/directives' ;
4647import {
4748 type GraphQLObjectType ,
@@ -1054,10 +1055,46 @@ function completeListValue(
10541055 // No need to modify the info object containing the path,
10551056 // since from here on it is not ever accessed by resolver functions.
10561057 const fieldPath = addPath ( path , index ) ;
1058+ const initialFieldNodes = [ ] ;
1059+ for ( const fieldNode of fieldNodes ) {
1060+ const stream = getDirectiveValues (
1061+ GraphQLStreamDirective ,
1062+ fieldNode ,
1063+ exeContext . variableValues ,
1064+ ) ;
1065+ if (
1066+ exeContext . schema . __experimentalStream &&
1067+ stream &&
1068+ stream . if !== false &&
1069+ index >= stream . initial_count
1070+ ) {
1071+ const patchErrors = [ ] ;
1072+ exeContext . dispatcher . add (
1073+ stream . label ,
1074+ fieldPath ,
1075+ ( ) =>
1076+ completeValueCatchingError (
1077+ exeContext ,
1078+ itemType ,
1079+ [ fieldNode ] ,
1080+ info ,
1081+ fieldPath ,
1082+ item ,
1083+ patchErrors ,
1084+ ) ,
1085+ patchErrors ,
1086+ ) ;
1087+ } else {
1088+ initialFieldNodes . push ( fieldNode ) ;
1089+ }
1090+ }
1091+ if ( ! initialFieldNodes . length ) {
1092+ return ;
1093+ }
10571094 const completedItem = completeValueCatchingError (
10581095 exeContext ,
10591096 itemType ,
1060- fieldNodes ,
1097+ initialFieldNodes ,
10611098 info ,
10621099 fieldPath ,
10631100 item ,
You can’t perform that action at this time.
0 commit comments