API / Apollo Gateway Interview questions
What is a query plan?
A query plan is the ordered set of fetch steps the gateway or router generates for a single incoming operation. It describes which subgraph(s) need to be called, whether those calls can happen in parallel or must happen in sequence, and how the entity representations needed for join steps get passed between them.
For example, a query asking for a product's name alongside its reviews and each reviewer's display name might plan as: fetch the product from the Products subgraph, then in parallel fetch reviews from the Reviews subgraph and the reviewer names from the Users subgraph using the IDs returned in the first step.
Because the plan's shape depends only on the query's structure — not on the actual variable values — both Gateway and Router cache query plans and reuse them for repeated operations, avoiding the cost of re-planning identical queries.
More Related questions...