Take subtypes into account when matching type conditions to extract representations #804
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.
The
executeSelectionSet
function inexecuteQueryPlan.ts
, which is used to extract field values from a result object to build up representations to send to a subgraph, only looked for exact matches of the__typename
to the type condition on an inline fragment. This wasn't an issue before, because the query plans we generated always contained an inline fragment per requested object type, never an abstract type condition.Recent changes in the way we handle scope surfaced this issue however, because it would sometimes wrap things in an additional inline fragment for a parent interface type (this has since been fixed in #805).
Although that means the issue won't arise for now, we do expect to make other changes that would require support for abstract type conditions (avoiding exploding types when they share an interface with a
@key
directive).