Skip to content

Commit

Permalink
fix: wait for promise resolution before returning
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris James committed Jul 28, 2020
1 parent e6cb2c7 commit c59c9c4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/delegate/src/delegateToSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,7 @@ export function delegateRequest({
info,
});

if (executionResult instanceof Promise) {
return executionResult.then(originalResult => transformer.transformResult(originalResult));
}
return transformer.transformResult(executionResult);
return Promise.resolve(executionResult).then(originalResult => transformer.transformResult(originalResult));
}

const subscriber =
Expand Down

0 comments on commit c59c9c4

Please sign in to comment.