Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@requires field always resolved from same subgraph #2801

Open
joshfoeh-bill opened this issue Oct 4, 2023 · 0 comments
Open

@requires field always resolved from same subgraph #2801

joshfoeh-bill opened this issue Oct 4, 2023 · 0 comments

Comments

@joshfoeh-bill
Copy link

Issue Description

If one subgraph @requires a field to resolve another field, and that other field is @Shareable defined in multiple subgraphs, the query plan seems to arbitrarily pick one subgraph to resolve the shareable field everytime.

This results in a less performant query plan because even if the subgraph that is resolving the query can resolve the @Shareable field as well, the query plan still includes the third subgraph just to resolve the shareable field.

Included in the reproduction project I also use @provides to explicitly provide the required field and yet it is still not resolved from the expected subgraph.

I would expect that @Shareable would build the most efficient query plan automatically, but especially would expect it when explicitly defining the query plan by using @provides.

Link to Reproduction

https://github.com/joshfoeh-bill/apollo-query-plan

Reproduction Steps

Reproduction steps included in readme of attached repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant