Skip to content

Commit

Permalink
Merge pull request #2 from igrlk/fix-abort-execution
Browse files Browse the repository at this point in the history
Fix aborted in tests
  • Loading branch information
ladal1 committed Oct 2, 2023
2 parents 1f851b3 + cb619c0 commit 77e6176
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,28 +262,15 @@ function executeImpl(
const data = executeOperation(exeContext, initialResultRecord);
if (isPromise(data)) {
return data.then(
(resolved) => {
exeContext.executionController.abort();
return incrementalPublisher.buildDataResponse(
initialResultRecord,
resolved,
);
},
(error) => {
exeContext.executionController.abort();
return incrementalPublisher.buildErrorResponse(
initialResultRecord,
error,
);
},
(resolved) =>
incrementalPublisher.buildDataResponse(initialResultRecord, resolved),
(error) =>
incrementalPublisher.buildErrorResponse(initialResultRecord, error),
);
}

exeContext.executionController.abort();
return incrementalPublisher.buildDataResponse(initialResultRecord, data);
} catch (error) {
exeContext.executionController.abort();

return incrementalPublisher.buildErrorResponse(initialResultRecord, error);
}
}
Expand Down

0 comments on commit 77e6176

Please sign in to comment.