Delete Subscriptions

Subscriptions to DELETE events will trigger on deleted nodes.

Only deleted nodes will trigger this event, deleted relationships will not trigger any event.

DELETE event

A subscription to a type can be made with the top-level subscription [type]Deleted. The subscription will contain the following fields:

  • event: The event triggering this subscription, in this case it will always be "DELETE".

  • deleted<typename>: The top-level properties of the deleted node, these will be the properties right before the node was deleted. Relationships are not available.

  • timestamp: The timestamp in which the mutation was made. Note that multiple events may come with the same timestamp if triggered by the same query.

Example

Considering the following type definitions:

type Movie {
    title: String
    genre: String
}

A subscription to any deleted Movie would look like:

subscription {
    movieDeleted {
        deletedMovie {
            title
        }
        event
        timestamp
    }
}