apollographql / federation-next

Moved to the Router repository
https://github.com/apollographql/router/tree/dev/apollo-federation
Other
19 stars 1 forks source link

Implementation of `QueryPlanner::build_query_plan` #242

Closed goto-bus-stop closed 5 months ago

goto-bus-stop commented 5 months ago

The scope of this PR is to implement build_query_plan and the top-level functions for the simple planning paths (no defer, and no mutations). After this PR, a call to build_query_plan should ideally hit a todo!() somewhere deeper inside the project, not at the top level. Some lifetime changes are required to existing code which is where most of the diff comes from.


planner.build_query_plan() can now run until we get to the processor stage (where the fetch dependency graph cost is calculated). I stopped there because processing is a big chunk of code that looks like it should be part of FED-62.

Notes on the changes to existing code:

Everything else is part of the build_query_plan function.

I left a few questions in the code tagged with XXX(@) that i don't think need to be fully addressed in this review but would be nice to check in case.