API / Apollo Gateway Interview questions
How do you debug query planning issues in Apollo Gateway?
Unexpected latency or extra network hops in a federated query is almost always a query-planning issue, and there's a fairly standard way to track it down.
- Inspect the actual query plan — Apollo Sandbox has a query plan panel that visualizes fetch nodes, showing which are sequential versus parallel.
- Look for chains of sequential fetches that could be parallelized; this often points to an unnecessary
@requiresdependency or a missing@providesoptimization. - Check subgraph schemas for missing or mismatched
@keyfields, which can force extra round trips to resolve an entity that should have been fetched in one call. - Add tracing (OpenTelemetry spans per fetch node) to see exactly where time is spent across subgraph calls.
- Use
rover subgraph checkto review composition hints before publishing a schema change that might be adding an unwanted extra hop.
Most planning inefficiencies trace back to how entities and their key fields are modeled, not to the planner itself doing something wrong.
More Related questions...