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 EDFS directives to your subgraph schema. 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. The Router subscribes to the configured topics.
Backend services publish events to the message broker when data changes. 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 WebSocket, SSE, or Multipart HTTP. Subgraphs never hold WebSocket connections.
Subgraphs emit events. The Router does the rest.

