Skip to content

Commit b520eb2

Browse files
authored
fix: handle leftovers recursively async (#1743)
1 parent 965b9e4 commit b520eb2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/tidy-moles-pretend.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@graphql-tools/delegate': patch
3+
---
4+
5+
Handle leftovers recursively but in async
6+
Fixes `requires-circular` test suite's second case on federation audit repository

packages/delegate/src/defaultMergedResolver.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ export function defaultMergedResolver(
101101
} else {
102102
// not all fields are present, we need to resolve more leftovers
103103
// this can occur when there are circular @requires, see requires-circular audit test
104-
handleLeftOver(parent, context, info, leftOver);
104+
setTimeout(() => {
105+
handleLeftOver(parent, context, info, leftOver);
106+
}, 0);
105107
}
106108
return deferred.promise;
107109
}

0 commit comments

Comments
 (0)