apollographql / rover

The CLI for Apollo GraphOS
https://rover.apollo.dev
Other
408 stars 85 forks source link

Generate query plan from a given subgraph list and operation #1807

Open smyrick opened 10 months ago

smyrick commented 10 months ago

Description

Today rover supergraph compose allows you to generate the supergraph locally with all customizations of subgraphs. Composition is a static and analyzable process of Federation that is very helpful, but at runtime there is another feature that is also analyzable and that is Query Plans.

Query Plans contain lots of metadata about how a given operation will behave and for complex operations, debugging query plans can be a helpful way to find issues. Instead of having to start up a Router and inspect results the the Explorer UI or make requests to GraphOS, it would be helpful to generate those locally and be able to power other custom tooling.

rover supergraph plan --supergraph supergraph.graphqls --operation myQuery.graphql

Maybe passing a collection of operations here is also easier to do batch jobs

rover supergraph plan --supergraph supergraph.graphqls --operations operations.json

Things to consider

smyrick commented 10 months ago

The solutions team has made a similar tool already: https://github.com/apollosolutions/generate-query-plan