forked from 99designs/gqlgen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve requests for federation entities in parallel
In apollo federation, we may be asked for data about a list of entities. These can typically be resolved in parallel, just as with sibling fields in ordinary GraphQL queries. Now we do! Note that I kept the behavior where if one lookup fails, we cancel the whole assembly. It's not clear to me if that's the ideal behavior -- there are arguments both ways -- but I figured it was easiest to retain it for now. (I used x/sync/errgroup to do so; it's already a transitive dep via x/tools but if the new direct dep is an issue I can do it with sync.Waitgroup instead, at the cost of some extra code.) The examples probably give the clearest picture of the changes. (And the clearest test; the changed functionality is already exercised by `integration-test.js` as watching the test server logs will attest.) Fixes 99designs#1278.
- Loading branch information
1 parent
07c1f93
commit 681f94b
Showing
6 changed files
with
128 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters