TL;DR
Jens invited David and Sergiy, the engineers behind Cosmo’s composition and query planning, to share how these systems evolved. Their key insight: composition and query planning are inseparable—composition handles resolvability and metadata, and query planning becomes faster and simpler as a result.
From Apollo-style composition to Cosmo’s approach
In the early days, Cosmo’s composition resembled Apollo’s: subgraphs meshed into a supergraph. Over time, David and Sergiy began shifting more logic into composition, so query planning could lean on structured metadata rather than re-checking everything.
Composition is doing a lot more checks than planning needs to do. Planning is much simpler.
Metadata, resolvability, and efficiency
Composition now produces execution metadata: which fields are external, what keys exist, and how subgraphs connect. This avoids duplicate checks in query planning and makes execution more efficient.
If we can do that work once in composition, and then basically save that result and pass it to the query, you’re saving doing that work again.
Why TypeScript for composition and Go for execution
Sergiy explained the team’s language choices: composition in TypeScript for flexibility and rapid iteration, execution in Go for speed. TypeScript also makes testing with mock subgraphs easy, even though production workloads run in Go.
TypeScript really allows you to iterate very fast… during testing, we always use JavaScript subgraphs because it is very fast to build some mocks.
The importance of explicit keys
The engineers warned about implicit keys. If one subgraph references a field as a key but the owning subgraph doesn’t mark it, removing it can silently break composition. Explicit definitions prevent hidden dependencies.
For me, it’s explicitness.
Federation standards work
Jens noted that David and Sergiy participate in the GraphQL Foundation’s composite schema working group. Their goal is to make federation less dependent on Apollo’s subgraph libraries, and to move toward shared standards across the ecosystem. This work ensures Cosmo’s approach aligns with industry-wide improvements while reducing fragmentation.
Looking ahead
The conversation also touched on scale: some customers manage graphs with 100,000+ types and fields. Jens mentioned that Marc-André from Netflix and others in the working group have discussed reducing the number of directives in future federation specs to simplify composition.
Jens closed by asking why people should join WunderGraph. David and Sergiy pointed to the team’s diversity and constant evolution as reasons they enjoy the work.
We are continuously improving… it’s not boring at all.
This episode was directed by Jacob Javor. Transcript lightly edited for clarity and flow.
