-
Notifications
You must be signed in to change notification settings - Fork 254
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
Removes special case to type explosion with fed1 supergraphs #1994
Merged
benweatherman
merged 3 commits into
apollographql:main
from
pcmanus:1988-type-explosion-fed1-supergraph
Jul 19, 2022
Merged
Removes special case to type explosion with fed1 supergraphs #1994
benweatherman
merged 3 commits into
apollographql:main
from
pcmanus:1988-type-explosion-fed1-supergraph
Jul 19, 2022
Conversation
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
👷 Deploy request for apollo-federation-docs pending review.Visit the deploys page to approve it
|
We usually avoid type-exploding the fetching of interface fields when we can avoid to, but we were avoiding this optimization where the input was a fed1-generated supergraph (essentially always type-exploding all interfaces). The initial reason for that avoidance was a combination of 2 things: 1. going too fast over this, I though this was what the fed1 query planning was doing, which is actually not 100% accurate. 2. fed1-generated supergraph have incomplete information when it goes to interface (really, all non-entity types), in that it does not record when those interfaces/values types are actually defined. This lead to known issues (in both fed1 and fed2-with-fed1-supergraph) and I took this as additional motivation to avoid relying on interface as much as possible (which type explosion kind of achieve). However, regarding the 1st point, fed1 happens to avoid type explosion when all the implementations of an interface are a value type, so not doing so is a sort of regression. And while we could mimick that fed1 behaviour, upon further reflexion, the rule we use for fed2 for this (which only type-explode specific fields where one of the implementation is either external or has as `@requires`) is actually fine with fed1 supergraphs. More precisely, the issues due to the incompletness of fed1 supergraph could be a problem with that rule _if_ an interface had different fieds defined in different subgraphs, but that's actually not allowed by fed1. Fixes apollographql#1988.
pcmanus
force-pushed
the
1988-type-explosion-fed1-supergraph
branch
from
July 19, 2022 08:52
9c2761d
to
e021efd
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
benweatherman
approved these changes
Jul 19, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐐
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We usually avoid type-exploding the fetching of interface fields when we
can avoid to, but we were avoiding this optimization where the input
was a fed1-generated supergraph (essentially always type-exploding all
interfaces).
The initial reason for that avoidance was a combination of 2 things:
planning was doing, which is actually not 100% accurate.
goes to interface (really, all non-entity types), in that it
does not record when those interfaces/values types are actually
defined. This lead to known issues (in both fed1 and
fed2-with-fed1-supergraph) and I took this as additional motivation
to avoid relying on interface as much as possible (which type
explosion kind of achieve).
However, regarding the 1st point, fed1 happens to avoid type explosion
when all the implementations of an interface are a value type, so not
doing so is a sort of regression. And while we could mimick that fed1
behaviour, upon further reflexion, the rule we use for fed2 for this
(which only type-explode specific fields where one of the implementation
is either external or has as
@requires
) is actually fine with fed1supergraphs. More precisely, the issues due to the incompletness of
fed1 supergraph could be a problem with that rule if an interface
had different fieds defined in different subgraphs, but that's actually
not allowed by fed1.