In the dynamic world of technology, GraphQL has emerged as a revolutionary data query language. But GraphQL at scale requires routing, directing queries across multiple subgraphs efficiently. This brings us to the Cosmo Router, a new entrant that promises speed, efficiency, and open-source capabilities.

In the simplest terms, a router in GraphQL acts as a manager that directs queries to the appropriate places, ensuring a smooth flow of data. In federated architectures, the router is the single entry point that understands the entire supergraph and routes each field to the correct subgraph.
When we talk about GraphQL routers, the Apollo Router has been a popular choice. However, the Cosmo Router comes with its own set of unique features, promising to be faster and more efficient.
The Cosmo Router comprises three main components:
For context on the broader Cosmo ecosystem, see the WunderGraph Cosmo introduction.
The Cosmo Router introduces the concept of label matcher, a feature that allows for efficient management of federated graphs, routing queries based on labels assigned to subgraphs.
One of the standout features of the Cosmo Router is its self-hostability. This means that businesses have the flexibility to run the router on their own infrastructure, giving them full control over their data and operations.
For performance, the Cosmo Router benchmarks at approximately 10x faster than the Apollo Router. This performance advantage is critical in enterprise environments where latency directly impacts user experience.
The Cosmo Router stands as a promising contender in the GraphQL space, offering speed, efficiency, and a range of features that make it a worthy choice for businesses managing GraphQL services at scale.
Next, read about WunderGraph Cosmo's open federation support, how it maintains compatibility with Apollo Federation v1 and v2 while remaining open source.