Subscriptions (Beta)

Subscriptions are only available as a beta; its API may change in the future. It is not recommended to use subscriptions in production environments.

GraphQL subscriptions add real-time capabilities to your API. Subscriptions allow to listen for changes on the database.

The following subscriptions are available when using @neo4j/graphql:

  • Create - Listen for newly created nodes.

  • Update - Listen for changes to existing nodes.

  • Delete - Listen for deleted nodes.

All events will be triggered individually, with one event per node created, updated or deleted, even in events caused by the same mutation.

Only changes made through @neo4j/graphql will trigger events. Changes made directly to the database or using the @cypher directive will not trigger any event.

Subscriptions with Auth

Some auth clauses can be used with subscriptions. How these work is documented here.