Our solution
Protocol translation and multiplexing in the Router
The Cosmo Router accepts five subscription protocols from clients and talks to each subgraph over WebSockets or SSE. It translates between protocols automatically.
How subscriptions work in Cosmo Router
Clients connect using their preferred protocol. graphql-ws is the default. SSE is recommended for unidirectional updates.
The Router accepts graphql-ws, SSE (GET and POST), Multipart HTTP, subscriptions-transport-ws, and Absinthe from clients.
The Router communicates with each subgraph using the protocol configured for that subgraph. Set per-subgraph protocol via the CLI.
Protocol translation is automatic. A legacy client using subscriptions-transport-ws can subscribe to a modern graphql-ws subgraph.
Connection multiplexing groups subscriptions with matching authentication headers into shared upstream connections.
The Router forwards extension field data (such as Bearer tokens) to subgraphs in the per-operation subscribe payload.
Clients use what they support. The Router handles the rest.

