-
Notifications
You must be signed in to change notification settings - Fork 15
Update subscriptions docs with 6.x changes #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6ac2de4
Update subscriptions docs with 6.x changes
angrykoala 18c3feb
Apply suggestions from code review
angrykoala 4b48d8f
Improve example on cdc section
angrykoala a5166df
Update modules/ROOT/pages/subscriptions/customize-cdc.adoc
angrykoala 76268a9
Update type configuration for subscriptions
angrykoala ecc2cb2
Merge remote-tracking branch 'origin/6.x' into update-subscriptions-docs
angrykoala 0ee9f9e
Merge branch '6.x' into update-subscriptions-docs
rsill-neo4j e2596c3
Apply suggestions from code review
angrykoala a84c1b4
Merge branch '6.x' into update-subscriptions-docs
rsill-neo4j File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| [[customize-cdc]] | ||
| = Customize CDC subscriptions | ||
| :page-aliases: subscriptions/plugins/index.adoc, subscriptions/plugins/amqp.adoc, subscriptions/plugins/single-instance.adoc | ||
| :description: This page describes how to customize the behavior of subscriptions. | ||
|
|
||
| GraphQL subscriptions to Neo4j use [Change Data Capture](https://neo4j.com/docs/cdc/current/) (CDC). | ||
| Its behavior can be configured by passing an instance of `Neo4jGraphQLSubscriptionsCDCEngine`. | ||
|
|
||
| == Neo4jGraphQLSubscriptionsCDCEngine | ||
|
|
||
| By default, the GraphQL library uses the same driver passed to `Neo4jGraphQL` to poll for events every second. | ||
| This behavior can be changed by creating a custom instance of `Neo4jGraphQLSubscriptionsCDCEngine`. | ||
|
|
||
| The following options can be passed to the constructor: | ||
|
|
||
| * `driver`: The driver to be used for CDC queries. | ||
| * `pollTime`: The interval, in milliseconds, between queries to CDC. | ||
| 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. | ||
|
|
||
| For example: | ||
mjfwebb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [source, javascript, indent=0] | ||
| ---- | ||
| import { Neo4jGraphQL, Neo4jGraphQLSubscriptionsCDCEngine } from '@neo4j/graphql'; | ||
|
|
||
| const engine = new Neo4jGraphQLSubscriptionsCDCEngine({ | ||
| driver, | ||
| pollTime: 5000 | ||
| }) | ||
|
|
||
| const neoSchema = new Neo4jGraphQL({ | ||
| typeDefs, | ||
| driver, | ||
| features: { | ||
| subscriptions: engine, | ||
| queryConfig: { | ||
| database: "neo4j", | ||
| } | ||
| }, | ||
| }); | ||
| ---- | ||
|
|
||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.