Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion modules/ROOT/pages/schema-configuration/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ However, in some cases, it may be advisable to reduce the scope of the API produ

This section provides information on how to limit access to unwanted operations and reduce the size of the schema which can improve the performance:

- xref::schema-configuration/index.adoc[Schema configuration] - How to restrict access to certain types or fields.
- xref::schema-configuration/field-configuration.adoc[Field configuration] - How to remove fields from a GraphQL Object Type or a GraphQL Input Object Type.
- xref::schema-configuration/global-configuration.adoc[Global configuration] - How to globally disable specific types of operation.
- xref::schema-configuration/type-configuration.adoc[Type configuration] - How to set up `Query`, `Mutation`, and `Subscription` types.
29 changes: 27 additions & 2 deletions modules/ROOT/pages/subscriptions/events.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,35 @@ subscriptions/events/update.adoc
This page covers a variety of subscription options offered by the Neo4j GraphQL Library.

[NOTE]
====
===
Only changes made through `@neo4j/graphql` should trigger the events here described.
Changes made directly to the database or using the xref::type-definitions/directives/cypher.adoc[`@cypher` directive] will **not** trigger any event.
====
===

== `CREATE`

Subscriptions to `CREATE` events listen *only* to newly created nodes, not new relationships.
In this occasion, a new event is triggered for each new node, containing its properties.

This action is performed with the top-level subscription `[type]Created`, which contains the following fields:

* `event`: the event triggering this subscription (in this case, `CREATE`).
* `created<typename>`: top-level properties of the newly created node, without relationships.
* `timestamp`: the timestamp in which the mutation was made.
If a same query triggers multiple events, they should have the same timestamp.

As an example, consider the following type definitions:

[source,graphql,indent=0]
----
type Movie {
title: String
genre: String
}
----

Note, however, that only changes made through `@neo4j/graphql` should trigger events.
Changes made directly to the database or using the xref::type-definitions/directives/cypher.adoc[`@cypher` directive] will **not** trigger any event.

== `CREATE`

Expand Down