-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't treat entity interface
__typename
refinements as useless (#2775)
Fix specific case for requesting `__typename` on interface entity type In certain cases, when resolving a `__typename` on an interface entity (due to it actual being requested in the operation), that fetch group could previously be trimmed / treated as useless. At a glance, it appears to be a redundant step, i.e.: ``` { ... on Product { __typename id }} => { ... on Product { __typename} } ``` It's actually necessary to preserve this in the case that we're coming from an interface object to an (entity) interface so that we can resolve the concrete `__typename` correctly. Ref: #2743 (this fixes one of the queries from the issue but not both)
- Loading branch information
1 parent
4fd562b
commit 66d7e4c
Showing
4 changed files
with
253 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
"@apollo/query-planner": patch | ||
"@apollo/subgraph": patch | ||
"@apollo/gateway": patch | ||
--- | ||
|
||
Fix specific case for requesting __typename on interface entity type | ||
|
||
In certain cases, when resolving a __typename on an interface entity (due to it actual being requested in the operation), that fetch group could previously be trimmed / treated as useless. At a glance, it appears to be a redundant step, i.e.: | ||
``` | ||
{ ... on Product { __typename id }} => { ... on Product { __typename} } | ||
``` | ||
It's actually necessary to preserve this in the case that we're coming from an interface object to an (entity) interface so that we can resolve the concrete __typename correctly. | ||
|
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 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 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