File tree 2 files changed +20
-10
lines changed
2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -531,11 +531,6 @@ describe('Execute: stream directive', () => {
531
531
} ,
532
532
] ,
533
533
} ,
534
- ] ,
535
- hasNext : true ,
536
- } ,
537
- {
538
- incremental : [
539
534
{
540
535
items : [ { name : 'Leia' , id : '3' } ] ,
541
536
path : [ 'friendList' , 2 ] ,
Original file line number Diff line number Diff line change @@ -1956,17 +1956,32 @@ function executeStreamField(
1956
1956
if ( isPromise ( item ) ) {
1957
1957
const completedItems = ( async ( ) => {
1958
1958
try {
1959
- return [
1960
- await completePromise (
1959
+ try {
1960
+ const resolved = await item ;
1961
+ const completed = completeValue (
1961
1962
exeContext ,
1962
1963
itemType ,
1963
1964
fieldNodes ,
1964
1965
info ,
1965
1966
itemPath ,
1966
- item ,
1967
+ resolved ,
1967
1968
asyncPayloadRecord ,
1968
- ) ,
1969
- ] ;
1969
+ ) ;
1970
+ if ( isPromise ( completed ) ) {
1971
+ return [ await completed ] ;
1972
+ }
1973
+ return [ completed ] ;
1974
+ } catch ( rawError ) {
1975
+ const errors = asyncPayloadRecord ?. errors ?? exeContext . errors ;
1976
+ const error = locatedError (
1977
+ rawError ,
1978
+ fieldNodes ,
1979
+ pathToArray ( itemPath ) ,
1980
+ ) ;
1981
+ const handledError = handleFieldError ( error , itemType , errors ) ;
1982
+ filterSubsequentPayloads ( exeContext , itemPath , asyncPayloadRecord ) ;
1983
+ return [ handledError ] ;
1984
+ }
1970
1985
} catch ( error ) {
1971
1986
asyncPayloadRecord . errors . push ( error ) ;
1972
1987
filterSubsequentPayloads ( exeContext , path , asyncPayloadRecord ) ;
You can’t perform that action at this time.
0 commit comments