Skip to content

Commit 9933dd4

Browse files
lidiazuinrecrwplaymjfwebbdarrellwarde
authored
Editorial review of the new CDC content #57 (#58)
* Add page-aliases for version 4 (#31) (#32) Co-authored-by: Neil Dewhurst <[email protected]> * Editorial review of the latest additions (#34) * Update publish.yml * Editorial review of the most recent changes * reverting changes to partials * fixing note formatting * Add page-aliases for version 4 (#31) (#32) Co-authored-by: Neil Dewhurst <[email protected]> * Editorial review of the most recent changes * fixing note formatting * Add page-aliases for version 4 (#31) (#32) Co-authored-by: Neil Dewhurst <[email protected]> * Editorial review of the most recent changes * fixing note formatting * Add page-aliases for version 4 (#31) (#32) Co-authored-by: Neil Dewhurst <[email protected]> * Editorial review of the most recent changes * Add page-aliases for version 4 (#31) * revert * Apply suggestions from code review Co-authored-by: Michael Webb <[email protected]> --------- Co-authored-by: Neil Dewhurst <[email protected]> Co-authored-by: Michael Webb <[email protected]> * Fix scalar description placeholders #38 (#39) * Editorial review of the most recent changes * reverting changes to partials * fixing note formatting * Add page-aliases for version 4 (#31) (#32) Co-authored-by: Neil Dewhurst <[email protected]> * Editorial review of the most recent changes * fixing note formatting * Editorial review of the most recent changes * fixing note formatting * Add page-aliases for version 4 (#31) (#32) Co-authored-by: Neil Dewhurst <[email protected]> * Editorial review of the most recent changes * Fix scalar description placeholders (#38) --------- Co-authored-by: Neil Dewhurst <[email protected]> Co-authored-by: Darrell Warde <[email protected]> * Editorial review of the most recent changes * reverting changes to partials * Add page-aliases for version 4 (#31) (#32) Co-authored-by: Neil Dewhurst <[email protected]> * Editorial review of the most recent changes * fixing note formatting * Editorial review of the most recent changes * fixing note formatting * Add page-aliases for version 4 (#31) (#32) Co-authored-by: Neil Dewhurst <[email protected]> * Editorial review of the most recent changes * cherry-pick --------- Co-authored-by: Neil Dewhurst <[email protected]> Co-authored-by: Michael Webb <[email protected]> Co-authored-by: Darrell Warde <[email protected]>
1 parent 3b0361d commit 9933dd4

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

modules/ROOT/pages/subscriptions/engines.adoc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,56 @@ new Neo4jGraphQL({
2424
This behavior enables a simple subscription system that works on a single instance.
2525
It is ideal for development, testing, and servers that do not require horizontal scaling.
2626

27+
[[CDC]]
28+
== Change Data Capture label:Beta[]
29+
30+
If your database supports Change Data Capture (CDC), you can use it as your mechanism for subscriptions using `Neo4jGraphQLSubscriptionsCDCEngine`.
31+
Make sure to follow the steps described on the link:https://neo4j.com/docs/cdc/current/[CDC Documentation] to enable it for your Neo4j instance.
32+
33+
Note that CDC-based subscriptions behave differently from other subscription mechanisms.
34+
In this case, it uses the native CDC events from Neo4j database.
35+
This has the following implications:
36+
37+
* Any database change, including those changes done outside of GraphQL, will be reported.
38+
* Relationship events are not supported at the moment.
39+
* No additional broker mechanism is required.
40+
All the events are received by all the instances of `@neo4j/graphql`.
41+
* Events are not triggered immediately but are polled to the database.
42+
43+
=== Usage
44+
45+
`Neo4jGraphQLSubscriptionsCDCEngine` can be imported directly from the library.
46+
The Neo4j driver is the only required argument:
47+
48+
[souce, javascript, indent=0]
49+
----
50+
import { Neo4jGraphQL, Neo4jGraphQLSubscriptionsCDCEngine } from '@neo4j/graphql';
51+
52+
const engine = new Neo4jGraphQLSubscriptionsCDCEngine({
53+
driver,
54+
})
55+
56+
const neoSchema = new Neo4jGraphQL({
57+
typeDefs,
58+
driver,
59+
features: {
60+
subscriptions: engine,
61+
},
62+
});
63+
----
64+
65+
=== API
66+
67+
The following options can be passed to the constructor:
68+
69+
* `driver`: The driver to be used for CDC queries.
70+
* `pollTime`: The interval, in milliseconds, between queries to CDC.
71+
Defaults to 100ms.
72+
Note that poll time is the period between one request finishing and the next one starting.
73+
The actual time it takes for CDC events to trigger the subscription also depend on your network.
74+
* `queryConfig`: An object with the driver query options to be passed to CDC requests.
75+
Use the `db` field to define the target database for CDC.
76+
2777
[[amqp]]
2878
== AMQP
2979

0 commit comments

Comments
 (0)