(Work in progress!) A GraphQL websocket server to facilitate GraphQL subscriptions (see Kadira's blog post for more info).
Clients should be able to subscribe to certain queries. For each subscription, the server should send a result for a query subscription every client-specified polling interval. Possible applications include getting information about new comments or deleted comments.
How is this different from a live query system (Meteor's)?
A GraphQL subscription system allows developers to specify exactly which data they want to look out for and how to handle that data. Meteor's live query system watches for all changes - this is hard to scale, because it gets more expensive as the number of possible data mutations grows.
Each message has a type, as well as associated fields depending on the message type.
Client -> Server
Client sends this message to start a subscription for a query.
GraphQL query string
GraphQL query variables
Client-generated subscription id
Client sends this message to end a subscription.
The id of the subscription that will be terminated.
Server -> Client
Server sends this message upon failing to register a subscription, in response to client subscription_start message.
Array of errors
ID of subscription that failed to be registered on the server.
GraphQL result sent periodically from server to client according to subscription.