Skip to content

Commit 2b5796a

Browse files
author
Sylvain Lebresne
authored
Refactor code to extract subgraphs from supergraphs (#2655)
The subgraph extraction code is currently written as a single method that handles all join spec versions. There is however a fair number of differences betwee the version 0.1 of the join spec (the one generated by federation 1) and its successor (generated by federation 2), due to 1) having no ownership in fed2 and 2) the join spec 0.2+ versions tracking types much more systematically. So this commit actually separate the code for extracting each versions, or more precisely, has one method for join 0.1 and one for join 0.2+ (the difference between join 0.2 and 0.3 are a lot more minor). Doing may increase the total LOC technically, but it also makes each version a lot clearer. This also allows to refactor the 0.2+ version a bit to use the fact that those version are more systematic in the metadata they provide, and do things a bit more efficiently.
1 parent 235b0e2 commit 2b5796a

3 files changed

Lines changed: 657 additions & 397 deletions

File tree

.changeset/rare-bottles-mate.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@apollo/federation-internals": minor
3+
---
4+
5+
Refactor/cleanup code that extract subgraphs schema from the supergraph during query planning.
6+

0 commit comments

Comments
 (0)