⬡ GraphQL
Beginner
What is a GraphQL subscription?
Answer
A subscription is a GraphQL operation for real-time updates. Instead of a one-time response, the server pushes data to the client whenever a specified event occurs. Example: subscription { messageAdded(chatId: "123") { id text author { name } } }. Subscriptions are typically implemented over WebSockets. The client connects, sends the subscription document, and the server streams events. Common use cases include live chat, real-time dashboards, live sports scores, and collaborative editing features.