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 {
42
42
GraphQLIncludeDirective ,
43
43
GraphQLSkipDirective ,
44
44
GraphQLDeferDirective ,
45
+ GraphQLStreamDirective ,
45
46
} from '../type/directives' ;
46
47
import {
47
48
type GraphQLObjectType ,
@@ -1051,10 +1052,46 @@ function completeListValue(
1051
1052
// No need to modify the info object containing the path,
1052
1053
// since from here on it is not ever accessed by resolver functions.
1053
1054
const fieldPath = addPath ( path , index ) ;
1055
+ const initialFieldNodes = [ ] ;
1056
+ for ( const fieldNode of fieldNodes ) {
1057
+ const stream = getDirectiveValues (
1058
+ GraphQLStreamDirective ,
1059
+ fieldNode ,
1060
+ exeContext . variableValues ,
1061
+ ) ;
1062
+ if (
1063
+ exeContext . schema . __experimentalStream &&
1064
+ stream &&
1065
+ stream . if !== false &&
1066
+ index >= stream . initial_count
1067
+ ) {
1068
+ const patchErrors = [ ] ;
1069
+ exeContext . dispatcher . add (
1070
+ stream . label ,
1071
+ fieldPath ,
1072
+ ( ) =>
1073
+ completeValueCatchingError (
1074
+ exeContext ,
1075
+ itemType ,
1076
+ [ fieldNode ] ,
1077
+ info ,
1078
+ fieldPath ,
1079
+ item ,
1080
+ patchErrors ,
1081
+ ) ,
1082
+ patchErrors ,
1083
+ ) ;
1084
+ } else {
1085
+ initialFieldNodes . push ( fieldNode ) ;
1086
+ }
1087
+ }
1088
+ if ( ! initialFieldNodes . length ) {
1089
+ return ;
1090
+ }
1054
1091
const completedItem = completeValueCatchingError (
1055
1092
exeContext ,
1056
1093
itemType ,
1057
- fieldNodes ,
1094
+ initialFieldNodes ,
1058
1095
info ,
1059
1096
fieldPath ,
1060
1097
item ,
You can’t perform that action at this time.
0 commit comments