-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Intra-subgraph logic of federated query graph creation #84
Conversation
src/query_graph/mod.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code defines the query graph data structure and some accessors, corresponding to the analogous parts of querygraph.ts in the JS codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is for building the query graph, corresponding to the relevant parts of querygraph.ts. Note that this PR only implements federated query graph creation (API query graph creation is only used by composition and will be deferred to later), and this PR specifically only implements the intra-subgraph part of federated query graph creation.
18a0e15
to
ac9b07e
Compare
a551912
to
32ed206
Compare
fd550dd
to
18466fc
Compare
eea28c6
to
824ff74
Compare
Are there tests for just the intra-subgraph logic? I think we should aim to get those in as soon as possible, the later we do it the more risk there is of some small discrepancy somewhere in the codebase being super hard to debug. |
…e to more generally use *_position (which removes a fair amount of lifetimes)
824ff74
to
2fa7923
Compare
@goto-bus-stop Agreed we should get tests in sooner rather than later; the main incentive behind getting code in is to unblock other work sooner. |
…0-beta.6` (apollographql/federation-next#85) This PR exists mainly to unblock the rebasing of apollographql/federation-next#80 and apollographql/federation-next#84, as they'll have merge conflicts with the updated code (and I'd like to update the code for those PRs today). After I've finished rebasing those two PRs, will file a PR for 2nd half (probably later today).
…raphql/federation-next#84) This PR implements the intra-subgraph logic of federated query graph creation. That is, it implements the business logic that is performed for each individual subgraph when creating a federated query graph. The inter-subraph logic will be a separate PR, to keep PRs smaller. Tests will be added in follow-up PRs. Some notes: - Regarding porting, while the JS codebase creates a separate query graph for each subgraph and then copies its nodes/edges over to the federated one, the Rust code in this PR starts out with a single query graph (the federated one), and each builder adds its nodes/edges to that one. This allows us to avoid copying all the subgraph query graphs (and makes the porting/working with `petgraph` a bit easier). - We introduce a few convenience functions for `FederationSchema`/positions in this PR. We use those in the `QueryGraph` logic, but I've also refactored `extract_subgraphs_from_supergraph()` logic to use them, which has simplified some functions/removed lifetimes (also some bugfixes). - This PR is stacked on top of apollographql/federation-next#80 .
This PR implements the intra-subgraph logic of federated query graph creation. That is, it implements the business logic that is performed for each individual subgraph when creating a federated query graph. The inter-subraph logic will be a separate PR, to keep PRs smaller. Tests will be added in follow-up PRs.
Some notes:
petgraph
a bit easier).FederationSchema
/positions in this PR. We use those in theQueryGraph
logic, but I've also refactoredextract_subgraphs_from_supergraph()
logic to use them, which has simplified some functions/removed lifetimes (also some bugfixes).