@@ -2094,6 +2094,28 @@ async function executeStreamIterator(
2094
2094
}
2095
2095
}
2096
2096
2097
+ function filterSubsequentPayloads (
2098
+ exeContext : ExecutionContext ,
2099
+ nullPath : Path ,
2100
+ currentAsyncRecord : AsyncPayloadRecord | undefined ,
2101
+ ) : void {
2102
+ const nullPathArray = pathToArray ( nullPath ) ;
2103
+ exeContext . publisher . filter ( ( asyncRecord ) => {
2104
+ if ( asyncRecord === currentAsyncRecord ) {
2105
+ // don't remove payload from where error originates
2106
+ return true ;
2107
+ }
2108
+ for ( let i = 0 ; i < nullPathArray . length ; i ++ ) {
2109
+ if ( asyncRecord . path [ i ] !== nullPathArray [ i ] ) {
2110
+ // asyncRecord points to a path unaffected by this payload
2111
+ return true ;
2112
+ }
2113
+ }
2114
+
2115
+ return false ;
2116
+ } ) ;
2117
+ }
2118
+
2097
2119
function toIncrementalResult (
2098
2120
asyncPayloadRecord : AsyncPayloadRecord ,
2099
2121
) : IncrementalResult {
@@ -2123,28 +2145,6 @@ function toPayload(
2123
2145
return incremental . length ? { incremental, hasNext } : { hasNext } ;
2124
2146
}
2125
2147
2126
- function filterSubsequentPayloads (
2127
- exeContext : ExecutionContext ,
2128
- nullPath : Path ,
2129
- currentAsyncRecord : AsyncPayloadRecord | undefined ,
2130
- ) : void {
2131
- const nullPathArray = pathToArray ( nullPath ) ;
2132
- exeContext . publisher . filter ( ( asyncRecord ) => {
2133
- if ( asyncRecord === currentAsyncRecord ) {
2134
- // don't remove payload from where error originates
2135
- return true ;
2136
- }
2137
- for ( let i = 0 ; i < nullPathArray . length ; i ++ ) {
2138
- if ( asyncRecord . path [ i ] !== nullPathArray [ i ] ) {
2139
- // asyncRecord points to a path unaffected by this payload
2140
- return true ;
2141
- }
2142
- }
2143
-
2144
- return false ;
2145
- } ) ;
2146
- }
2147
-
2148
2148
class DeferredFragmentRecord {
2149
2149
type : 'defer' ;
2150
2150
errors : Array < GraphQLError > ;
0 commit comments