Home / Companies / Wundergraph / Blog / Post Details
Content Deep Dive

Cosmo Streams: GraphQL Subscriptions Without the Hurdle

Blog post from Wundergraph

Post Details
Company
Date Published
Author
Dominik Korittki
Word Count
1,243
Language
English
Hacker News Points
-
Summary

Cosmo Streams is a feature designed to facilitate the integration of event-driven systems with GraphQL subscriptions, eliminating the need for a separate translation layer. By connecting directly to message brokers such as Kafka, NATS, or Redis, the Cosmo Router manages subscription delivery, authorization, filtering, and event handling processes. This approach simplifies the integration of GraphQL by allowing subscriptions to be managed at the router level, thus removing the need for subgraphs to handle stateful, long-running client connections or implement subscriptions. Cosmo Streams also supports publishing events via GraphQL mutations, enabling GraphQL to function as both a consumer and producer in an event-driven architecture. Customization is achieved through router hooks written in Go, which can implement custom logic for subscription initiation, event reception, and publication. This setup preserves the existing event-driven federated subscriptions (EDFS) model while offering enhanced control and efficiency, suitable for serverless environments where long-running connections are impractical. The system is designed to optimize resource handling and support customization without the need for additional services, thus reducing the operational burden on platform teams.