Skip to content

Commit

Permalink
preserve key response order (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR authored Jan 27, 2022
1 parent db83cc1 commit 53a698e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-penguins-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'graphql-executor': patch
---

preserve key order when promises resolves out of order
2 changes: 2 additions & 0 deletions src/execution/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,8 @@ export class Executor {

if (result !== undefined) {
if (isPromise(result)) {
// set key to undefined to preserve key order
results[responseName] = undefined;
const promise = result.then((resolved) => {
results[responseName] = resolved;
});
Expand Down

0 comments on commit 53a698e

Please sign in to comment.