@@ -2039,6 +2039,28 @@ async function executeStreamIterator(
20392039 }
20402040}
20412041
2042+ function filterSubsequentPayloads (
2043+ exeContext : ExecutionContext ,
2044+ nullPath : Path ,
2045+ currentAsyncRecord : AsyncPayloadRecord | undefined ,
2046+ ) : void {
2047+ const nullPathArray = pathToArray ( nullPath ) ;
2048+ exeContext . publisher . filter ( ( asyncRecord ) => {
2049+ if ( asyncRecord === currentAsyncRecord ) {
2050+ // don't remove payload from where error originates
2051+ return true ;
2052+ }
2053+ for ( let i = 0 ; i < nullPathArray . length ; i ++ ) {
2054+ if ( asyncRecord . path [ i ] !== nullPathArray [ i ] ) {
2055+ // asyncRecord points to a path unaffected by this payload
2056+ return true ;
2057+ }
2058+ }
2059+
2060+ return false ;
2061+ } ) ;
2062+ }
2063+
20422064function toIncrementalResult (
20432065 asyncPayloadRecord : AsyncPayloadRecord ,
20442066) : IncrementalResult {
@@ -2068,28 +2090,6 @@ function toPayload(
20682090 return incremental . length ? { incremental, hasNext } : { hasNext } ;
20692091}
20702092
2071- function filterSubsequentPayloads (
2072- exeContext : ExecutionContext ,
2073- nullPath : Path ,
2074- currentAsyncRecord : AsyncPayloadRecord | undefined ,
2075- ) : void {
2076- const nullPathArray = pathToArray ( nullPath ) ;
2077- exeContext . publisher . filter ( ( asyncRecord ) => {
2078- if ( asyncRecord === currentAsyncRecord ) {
2079- // don't remove payload from where error originates
2080- return true ;
2081- }
2082- for ( let i = 0 ; i < nullPathArray . length ; i ++ ) {
2083- if ( asyncRecord . path [ i ] !== nullPathArray [ i ] ) {
2084- // asyncRecord points to a path unaffected by this payload
2085- return true ;
2086- }
2087- }
2088-
2089- return false ;
2090- } ) ;
2091- }
2092-
20932093class DeferredFragmentRecord {
20942094 type : 'defer' ;
20952095 errors : Array < GraphQLError > ;
0 commit comments