@@ -2039,6 +2039,28 @@ async function executeStreamIterator(
2039
2039
}
2040
2040
}
2041
2041
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
+
2042
2064
function toIncrementalResult (
2043
2065
asyncPayloadRecord : AsyncPayloadRecord ,
2044
2066
) : IncrementalResult {
@@ -2068,28 +2090,6 @@ function toPayload(
2068
2090
return incremental . length ? { incremental, hasNext } : { hasNext } ;
2069
2091
}
2070
2092
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
-
2093
2093
class DeferredFragmentRecord {
2094
2094
type : 'defer' ;
2095
2095
errors : Array < GraphQLError > ;
0 commit comments