You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say you have me query which returns type User defined in Accounts service. The current user can have some reviews which are served from Reviews service.
Let's say current user ID is known based on JWT token in an Authorization header.
When asking for:
me {
reviews
}
the GQL gateway queries accounts service even though the client does not ask for any attributes from it. This seems unnecessary.
QueryPlan {
Sequence {
Fetch(service: "accounts") {
{
me {
__typename
}
}
},
Flatten(path: "me") {
Fetch(service: "reviews") {
{
... on User {
__typename
}
} =>
{
... on User {
reviews {
body
}
}
}
},
},
},
}
The expected behavior would be that only a single query to Reviews service is sent and no query gets sent to the Accounts service.
Checklist for myself
A short, but descriptive title. The title doesn't need "Apollo" in it.
The package name and version of Apollo showing the problem.
If applicable, the last version of Apollo where the problem did not occur.
The expected behavior.
The actual behavior.
A simple, runnable reproduction!
Please make a GitHub repository that anyone can clone and run and see the
problem. Other great ways to demonstrate a reproduction are using our
CodeSandbox template (https://codesandbox.io/s/apollo-server), or re-mixing
our Glitch template (https://glitch.com/~apollo-launchpad).
The text was updated successfully, but these errors were encountered:
abernix
transferred this issue from apollographql/apollo-server
Jan 15, 2021
Let's say you have
me
query which returns typeUser
defined inAccounts
service. The current user can have some reviews which are served fromReviews
service.Let's say current user ID is known based on JWT token in an Authorization header.
When asking for:
the GQL gateway queries accounts service even though the client does not ask for any attributes from it. This seems unnecessary.
The expected behavior would be that only a single query to Reviews service is sent and no query gets sent to the Accounts service.
Checklist for myself
Please make a GitHub repository that anyone can clone and run and see the
problem. Other great ways to demonstrate a reproduction are using our
CodeSandbox template (https://codesandbox.io/s/apollo-server), or re-mixing
our Glitch template (https://glitch.com/~apollo-launchpad).
The text was updated successfully, but these errors were encountered: