The Good Thing Podcast

Meet the Masterminds Behind Composition and Query Planning

February 28, 2025
Hosted by Jens Neuse
Directed by Jacob Javor

Featuring:

David Stutt
David Stutt
Founding Engineer at WunderGraph
Sergiy Petrunin
Sergiy Petrunin
Founding Engineer at WunderGraph

Jens sits down with David and Sergiy to explore how composition and query planning evolved in Cosmo and why these two processes are inseparable.

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.

Frequently Asked Questions

What is the relationship between composition and query planning?

They are tightly coupled. Composition performs resolvability checks and produces metadata, which allows query planning to be simpler and faster.

Why does WunderGraph use TypeScript for composition and Go for execution?

Sergiy noted that TypeScript enables fast iteration and testing, while the execution engine is in Go for performance. Rewriting one in the other would be a huge investment.

What is an implicit key in Federation?

David described an implicit key as a field not marked as a key in its own subgraph but referenced as one elsewhere. Removing it can break composition, so explicitness is critical.

Never miss an episode

Subscribe to The Good Thing to get notified when new episodes drop.

About the Hosts

Jens Neuse

About Jens Neuse

CEO & Co-Founder at WunderGraph

Jens Neuse is the CEO and one of the co-founders of WunderGraph, where he builds scalable API infrastructure with a focus on federation and AI-native workflows. Formerly an engineer at Tyk Technologies, he created graphql-go-tools, now widely used in the open source community. Jens designed the original WunderGraph SDK and led its evolution into Cosmo, an open-source federation platform adopted by global enterprises. He writes about systems design, organizational structure, and how Conway's Law shapes API architecture.