
Event Lifecycle Control in GraphQL Subscriptions
Cosmo Streams adds three handlers to the router that control subscription behavior: authorization when a client subscribes, per-subscriber filtering while events flow, and validation when mutations publish events. Instead of building custom subscription infrastructure, you write Go functions that run at specific points in the event lifecycle. What EDFS Already Solved EDFS connects your message broker to GraphQL subscriptions. The router listens for events and publishes them as subscriptions. This remains the foundation of how Cosmo Streams operates. Cosmo Streams extends that by moving subscription authorization, event filtering, and mutation validation into the router itself. Three handlers cover three stages: when a subscription starts, while events are in flight, and when mutations publish events. Authorization Was All or Nothing EDFS gave you binary access: authenticated users could subscribe to any topic. There was no way to scope access based on roles, user attributes, or subscri
Continue reading on Dev.to
Opens in a new tab



