v5: polymorphic optimization opportunity
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 625
- Avg merge
- 5h 23m
- Merged PRs (30d)
- 24
Description
ref: `grafast/grafast/__tests__/dcc/queries/best-friends.test.graphql`

When querying through the same operation path, where one planning path crosses more polymorphic boundaries than another, the polymorphic fold-in system doesn't fire. In the diagram above, we should be able to recombine the `ActiveCrawler` path with the path used for `NPC`s such that only one call to `` is needed.
```graphql
{
character(id: 102) {
id
name
... on ActiveCrawler {
bestFriend {
__typename
id
name
... on HasInventory {
items {
__typename
id
name
}
}
}
}
... on NPC {
bestFriend {
__typename
id
name
... on HasInventory {
items {
__typename
id
name
}
}
}
}
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.