Our solution
Pass any JSON context from clients to subgraphs, including subscriptions
The GraphQL extensions object is the spec-backed place for structured client context. Cosmo Router forwards it to subgraphs by default—queries, mutations, and subscriptions—without a feature flag or a custom side channel.
What happens at request time
The router attaches the client's `extensions` object to each outgoing subgraph request, so structured payloads stay JSON-shaped end to end for queries, mutations, and subscriptions.
GraphQL over HTTP defines `extensions` as a JSON object next to `query` and `variables`. Clients put whatever structured data they need there, and the router forwards it untouched to every subgraph involved in the operation.
For `graphql-ws` subscriptions, `extensions` lives in the subscription message payload—the reliable way to attach per-operation data on a shared WebSocket. No configuration; it works by default.
Subgraphs read the fields they care about; the router does not reshape or flatten the JSON.
Default-on passthrough: customize only when you need to.

