Skip to content
Merged
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
13 changes: 8 additions & 5 deletions modules/ROOT/pages/subscriptions/customize-cdc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ Defaults to 1000ms.
Note that poll time is the period between a finished request and the start of the next.
The actual time it takes for CDC events to trigger the subscription also depends on your network.
* `queryConfig`: An object with the driver query options to be passed to CDC requests.
Use the `db` field to define the target database for CDC.
Use the `db` field to define the target database for CDC.
* `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.
Note that if this flag is set to `true`, changes made with a different version of the `@neo4j/graphql` will not trigger subscriptions.

For example:

Expand All @@ -29,17 +31,18 @@ import { Neo4jGraphQL, Neo4jGraphQLSubscriptionsCDCEngine } from '@neo4j/graphql

const engine = new Neo4jGraphQLSubscriptionsCDCEngine({
driver,
pollTime: 5000
pollTime: 5000,
queryConfig: {
database: "neo4j",
},
onlyGraphQLEvents: true
})

const neoSchema = new Neo4jGraphQL({
typeDefs,
driver,
features: {
subscriptions: engine,
queryConfig: {
database: "neo4j",
}
},
});
----
Expand Down