Our solution
Protocol translation and multiplexing in the Router
The Cosmo Router supports five subscription protocols between clients and subgraphs. It translates between protocols automatically, so clients and subgraphs can use whatever they support.
How subscriptions work in Cosmo Router
Clients connect using their preferred protocol. graphql-ws is the default. SSE and Multipart HTTP are recommended for unidirectional update streams.
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.

