Our solution
The Router subscribes. Subgraphs stay stateless.
Cosmo Streams connects the Router directly to your message broker. Subgraphs publish events when data changes. The Router determines which client subscriptions are affected, deduplicates fetch work, and pushes updates over WebSocket, SSE, or Multipart HTTP.
How Cosmo Streams works
Add Cosmo Streams directives to an Event-Driven Graph, a schema-only subgraph that is never implemented. Map subscription fields to Kafka topics, NATS subjects, or Redis channels using @edfs__kafkaSubscribe, @edfs__natsSubscribe, or @edfs__redisSubscribe.
Configure the Router with your message broker connection. When a client subscribes, the Router subscribes to the matching topic, subject, or channel.
Backend services publish events to the message broker when data changes. Each event carries the entity __typename and its key fields. Subgraphs handle only plain HTTP requests.
When an event arrives, the Router identifies affected client subscriptions and deduplicates fetch requests.
The Router fetches updated data from subgraphs via plain HTTP and broadcasts results to clients.
Clients receive updates over graphql-ws, Server-Sent Events, multipart HTTP, or the legacy subscriptions-transport-ws and absinthe. Subgraphs never hold WebSocket connections.
Subgraphs emit events. The Router does the rest.

