-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deal with interfaces on fragment spreads when no __typename is queried (
#3718) Fix #2587 Operations would over rely on the presence of __typename to resolve selection sets on interface implementers. This changeset checks for the parent type in an InlineFragment, so we don't drop relevant selection set when applicable.
- Loading branch information
Showing
9 changed files
with
362 additions
and
12 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,5 @@ | ||
### Deal with interfaces on fragment spreads when no __typename is queried ([Issue #2587](https://github.com/apollographql/router/issues/2587)) | ||
|
||
Operations would over rely on the presence of __typename to resolve selection sets on interface implementers. This changeset checks for the parent type in an InlineFragment, so we don't drop relevant selection set when applicable. | ||
|
||
By [@o0Ignition0o](https://github.com/o0Ignition0o) and [@geal](https://github.com/geal) in https://github.com/apollographql/router/pull/3718 |
13 changes: 13 additions & 0 deletions
13
...shots/apollo_router__services__supergraph_service__tests__no_typename_on_interface-2.snap
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,13 @@ | ||
--- | ||
source: apollo-router/src/services/supergraph_service.rs | ||
expression: with_typename | ||
--- | ||
{ | ||
"data": { | ||
"dog": { | ||
"id": "8765", | ||
"__typename": "Dog", | ||
"name": "Spot" | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...shots/apollo_router__services__supergraph_service__tests__no_typename_on_interface-3.snap
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,12 @@ | ||
--- | ||
source: apollo-router/src/services/supergraph_service.rs | ||
expression: with_reversed_fragments | ||
--- | ||
{ | ||
"data": { | ||
"dog": { | ||
"name": "Spot", | ||
"id": "0000" | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...apshots/apollo_router__services__supergraph_service__tests__no_typename_on_interface.snap
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,12 @@ | ||
--- | ||
source: apollo-router/src/services/supergraph_service.rs | ||
expression: no_typename | ||
--- | ||
{ | ||
"data": { | ||
"dog": { | ||
"id": "4321", | ||
"name": "Spot" | ||
} | ||
} | ||
} |
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
Oops, something went wrong.