Sending multiple queries/mutations combined in one request. #90
renepardon
started this conversation in
Ideas
Replies: 1 comment
-
The proposed API looks decent and I see the value in ad-hoc composition of queries in code. However, I presume it might take a lot of tricky implementation and design work - how would this interact with the HTTP client (which is pluggable), with mocking/testing, with the generated code? Something that works now is to formulate a single large query/mutation that does all the things you need in one go: query UserAndRoles($id: ID!) {
user(id: $ID) { ... }
roles { ... }
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you implement complex views based on microservice (GraphQL Federation), you might end up doing this with spawnia/sailor:
Therefore it would be pretty nice to be able to combine all queries in one request against the API Gateway rather than doing 4 requests.
I could think about using the global Operation class to do something like:
$result
would then contain a combined result for the requested user and all available roles. Something similar I could imagine for mutations.Beta Was this translation helpful? Give feedback.
All reactions