Skip to content

Commit b67f4b8

Browse files
authored
Merge pull request #243 from neo4j/backport/7.x/pr-221
[Cherry-pick][7.x] Merge pull request #221 from neo4j/update-cdc-docs
2 parents 26bb2a6 + 9dbe2dd commit b67f4b8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

modules/ROOT/pages/subscriptions/customize-cdc.adoc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Defaults to 1000ms.
1919
Note that poll time is the period between a finished request and the start of the next.
2020
The actual time it takes for CDC events to trigger the subscription also depends on your network.
2121
* `queryConfig`: An object with the driver query options to be passed to CDC requests.
22-
Use the `db` field to define the target database for CDC.
22+
Use the `db` field to define the target database for CDC.
23+
* `onlyGraphQLEvents`: By default, subscriptions capture all changes done to the database. If this flag is set to `true`, only changes made through GraphQL will trigger the subscription.
24+
Note that if this flag is set to `true`, changes made with a different version of the `@neo4j/graphql` will not trigger subscriptions.
2325

2426
For example:
2527

@@ -29,17 +31,18 @@ import { Neo4jGraphQL, Neo4jGraphQLSubscriptionsCDCEngine } from '@neo4j/graphql
2931
3032
const engine = new Neo4jGraphQLSubscriptionsCDCEngine({
3133
driver,
32-
pollTime: 5000
34+
pollTime: 5000,
35+
queryConfig: {
36+
database: "neo4j",
37+
},
38+
onlyGraphQLEvents: true
3339
})
3440
3541
const neoSchema = new Neo4jGraphQL({
3642
typeDefs,
3743
driver,
3844
features: {
3945
subscriptions: engine,
40-
queryConfig: {
41-
database: "neo4j",
42-
}
4346
},
4447
});
4548
----

0 commit comments

Comments
 (0)