We’re overhauling Dgraph’s docs to make them clearer and more approachable. If
you notice any issues during this transition or have suggestions, please
let us know.
@withSubscription
directive enables subscription operation on a
GraphQL type.
A subscription notifies your client with changes to back-end data using the
WebSocket protocol. Subscriptions are useful to get low-latency, real-time
updates.
To enable subscriptions on any type add the @withSubscription
directive to the
schema as part of the type definition, as in the following example: