PART 1 · VISUAL CONCEPT 04

Supergraph Composition & Query Planner DAG

How does Apollo Router compile a federated GraphQL query into a parallel execution DAG—and catch schema conflicts before deploy?

Interactive Lab 01 · Query Planner DAG & Critical Path

Compiled QueryPlan DAG & Parallel vs. Sequential Waterfall

Parallel Fan-Out · Step 4 / 4
Plan Compile Time 0.04 ms (LRU HIT) SHA-256 normalized AST
Subgraph Fetches 3 Fetches (2 Parallel) Users → (Orders || Reviews)
Critical Path Latency 80.0 ms vs 118.0 ms sequential (-38ms)
Active DAG Node Flatten(path: "user") Click any SVG node to inspect
Synchronized Execution Waterfall (ms) -38 ms saved via Parallel DAG
Compiled QueryPlan Tree Apollo Router IR
Active Node Sub-Query & Representation Selected Node
Interactive Lab 02 · Build-Time CI/CD Validator

Supergraph Composition Gate

Composition runs at build/deploy time—validating subgraph SDLs and emitting @join__field routing metadata before traffic ever hits the Router.

COMPOSED · 0 ERRORS
PASS · 0 ERRORS

All 3 subgraph SDLs compose cleanly with zero type conflicts or unsatisfiable entity paths.

rover supergraph compose
Mental Model · 28 Lines of Pure TypeScript

queryPlanner.ts — Partitioning & Parallel DAG Compilation

queryPlanner.ts

      

Build-Time Composition, Zero Runtime Stitching

Subgraph conflicts like FIELD_TYPE_MISMATCH or missing @shareable break CI/CD before deploy—never live production traffic.

Critical Path = max(), Not sum()

Parallel DAG nodes fire independent subgraph fetches concurrently, collapsing wall-clock latency to the slowest single branch.

Plan Caching Makes Planning O(1)

Normalized query AST hashes reuse compiled DAGs from an in-memory LRU cache in < 0.05 ms across millions of requests.