Skip to content

Commit

Permalink
Changesets on subscriptions changes
Browse files Browse the repository at this point in the history
  • Loading branch information
angrykoala committed Oct 16, 2024
1 parent 14cf80c commit 98e04db
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .changeset/curly-taxis-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@neo4j/graphql": major
---

Remove support for relationship subscriptions:

- `*RelationshipCreated`
- `*RelatiosnhipDeleted`
29 changes: 29 additions & 0 deletions .changeset/great-beans-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
"@neo4j/graphql": major
---

Removes support for non-cdc subscriptions. This means the only available engine for subscriptions is `Neo4jGraphQLSubscriptionsCDCEngine`:

```ts
new Neo4jGraphQL({
typeDefs,
driver,
features: {
subscriptions: new Neo4jGraphQLSubscriptionsCDCEngine({
driver,
}),
},
});
```

The default behaviour of subscriptions has also been updated to use CDC, so now passing `true` will use the CDC engine with the default parameters and driver:

```ts
new Neo4jGraphQL({
typeDefs,
driver,
features: {
subscriptions: true,
},
});
```
2 changes: 1 addition & 1 deletion packages/graphql/src/schema/make-augmented-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function makeAugmentedSchema({
});

if (features?.subscriptions && nodes.length) {
// TODO: update this thing
// TODO: Update CDC
const isCDCEngine = true;
generateSubscriptionTypes({
schemaComposer: composer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function generateSubscribeMethod({
});
}

// TODO: remove me!!
// TODO: Remove
if (["create_relationship", "delete_relationship"].includes(type)) {
return filterAsyncIterator<SubscriptionsEvent[]>(iterable, (data) => {
if (!isRelationshipSubscriptionEvent(data[0])) {
Expand Down

0 comments on commit 98e04db

Please sign in to comment.