Filtering and Scaling Subscriptions
Go beyond basic subscriptions: deliver only the events each client cares about with server-side filtering, and scale subscriptions across multiple Spring Boot instances.
Not Every Client Wants Everything
A naive subscription pushes every event to every subscriber. But a user watching order #42 does not care about order #99.
Filtering ensures each subscriber only receives the events relevant to them.
Subscription Arguments
Subscriptions can take arguments just like queries. A client passes the ID it cares about, and the server uses it to filter the stream.
type Subscription {
orderUpdated(orderId: ID!): Order
}All lessons in this course
- Understanding GraphQL Subscriptions
- Implementing Real-time Updates
- Integrating WebSockets with Spring
- Filtering and Scaling Subscriptions