-
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
Interface object #2279
Merged
Merged
Interface object #2279
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
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. |
pcmanus
force-pushed
the
interfaceObject
branch
from
November 28, 2022 12:07
5427f3c
to
cb6dc46
Compare
clenfest
reviewed
Dec 8, 2022
pcmanus
force-pushed
the
interfaceObject
branch
from
December 8, 2022 14:44
cb6dc46
to
6d44d54
Compare
clenfest
approved these changes
Dec 13, 2022
Add support for the newly added `@interfaceObject` directive and for `@key` on interfaces, in order to allow using interfaces as abstraction accross subgraphs. See apollographql#2277 for details. Fixes apollographql#2277.
pcmanus
force-pushed
the
interfaceObject
branch
from
December 14, 2022 10:16
47ce7db
to
2fb8f7e
Compare
jeffjakub
added a commit
that referenced
this pull request
Dec 16, 2022
* Implements @interfaceObject and @key on interfaces (#2279) Add support for the newly added `@interfaceObject` directive and for `@key` on interfaces, in order to allow using interfaces as abstraction across subgraphs. See #2277 for details. Fixes #2277. * Preserves source of union members and enum values in supergraph (#2288) While composition allows unions and enums to differ between subgraphs (at least under certain conditions), the supergraph currently was not preserving which subgraph defined which union member/enum value, and in particular the query planner made the (sometimes incorrect) assumption that unions and enums were defined the same in all the subgraphs in which they are defined. As shown in #2256, this was leading to genuine issues in the case of unions, where the query planner was generating invalid subgraph queries. I am not sure this created similar issues for enum values due to a combination of how the merging rule for enum work and the fact that values of enum are not types, but it is nonetheless a bad idea to run the query planner with incorrect information on the subgraph it generates queries for, and this can get in the way of other toolings that wants to use the supergraph (for instance, this gets in the way of #2250). To fix this, this patch ensures the supergraph preserve the information regarding which subgraph defines which union member and enum values in the supergraph by adding 2 new dedicated "join spec" directives. Fixes #2256. * Use alias in QP when querying conflicting fields (#2294) * Use alias in QP when querying conflicting fields In a few situations, the query planner was generating queries where the same response name was queried at the same "level" with incompatible types, resulting in invalid queries (the queries were failing the [`FieldsInSetCanMerge`](https://spec.graphql.org/draft/#FieldsInSetCanMerge())) validation for the GraphQL sepc). This commit detects this case, and when it would happen, aliases one of the occurence in the fetch to make the query valid. Once receiving the fetch result, the aliased value is rewritten to it's original response name. Fixes #1257 * Review feedback: add test for alias conflicts and fix related code * Regen error doc * Release - @apollo/[email protected] - [email protected] - @apollo/[email protected] - @apollo/[email protected] - @apollo/[email protected] - @apollo/[email protected] - @apollo/[email protected] Co-authored-by: Sylvain Lebresne <[email protected]>
This was referenced Sep 13, 2023
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.
Adds support for the newly added
@interfaceObject
directive and for@key
on interfaces, in order to allow using interfaces as abstraction accross subgraphs. See #2277 for details.Fixes #2277.