Skip to content

Commit f79b685

Browse files
authored
Merge pull request #5965 from neo4j/calver-4
Fix for CalVer (4.x)
2 parents cc4353e + 8b7c4ee commit f79b685

File tree

6 files changed

+33
-42
lines changed

6 files changed

+33
-42
lines changed

.changeset/serious-paws-hunt.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@neo4j/graphql": patch
3+
---
4+
5+
Add support for CalVer editions of neo4j

.github/workflows/pull-request-opened.yml

-22
This file was deleted.

packages/graphql/src/classes/Neo4jDatabaseInfo.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@ describe("Neo4jDatabaseInfo", () => {
2929
return new Neo4jDatabaseInfo("this_seems_not_valid", "enterprise");
3030
}).toThrow();
3131
});
32+
33+
test("should accept CalVar", () => {
34+
const dbInfo = new Neo4jDatabaseInfo("2025.01.0-aura", "enterprise");
35+
expect(dbInfo).toBeInstanceOf(Neo4jDatabaseInfo);
36+
});
3237
});

packages/graphql/src/classes/Neo4jDatabaseInfo.ts

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export class Neo4jDatabaseInfo {
2929
public edition: Neo4jEdition | undefined;
3030

3131
constructor(version: string, edition?: Neo4jEdition) {
32+
// Quick hack to support CalVar
33+
version = version.replace(/\.0([0-9]+)/, ".$1");
3234
this.version = this.toSemVer(version);
3335
this.rawVersion = version;
3436
this.edition = edition;

packages/graphql/tests/integration/subscriptions/create-relationship/create.int.test.ts

+17-17
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
import { graphql } from "graphql";
2121
import type { Driver } from "neo4j-driver";
22-
import { cleanNodes } from "../../../utils/clean-nodes";
2322
import { Neo4jGraphQL } from "../../../../src";
23+
import { cleanNodes } from "../../../utils/clean-nodes";
2424
import { UniqueType } from "../../../utils/graphql-types";
2525
import { TestSubscriptionsEngine } from "../../../utils/TestSubscriptionsEngine";
2626
import Neo4j from "../../neo4j";
@@ -194,7 +194,7 @@ describe("Subscriptions connect with create", () => {
194194
expect(plugin.eventList).toEqual(
195195
expect.arrayContaining([
196196
{
197-
id: expect.any(Number),
197+
id: expect.anything(),
198198
id_from: expect.any(Number),
199199
id_to: expect.any(Number),
200200
timestamp: expect.any(Number),
@@ -217,7 +217,7 @@ describe("Subscriptions connect with create", () => {
217217
toTypename: typeMovie.name,
218218
},
219219
{
220-
id: expect.any(Number),
220+
id: expect.anything(),
221221
id_from: expect.any(Number),
222222
id_to: expect.any(Number),
223223
timestamp: expect.any(Number),
@@ -240,7 +240,7 @@ describe("Subscriptions connect with create", () => {
240240
toTypename: typeMovie.name,
241241
},
242242
{
243-
id: expect.any(Number),
243+
id: expect.anything(),
244244
id_from: expect.any(Number),
245245
id_to: expect.any(Number),
246246
timestamp: expect.any(Number),
@@ -263,7 +263,7 @@ describe("Subscriptions connect with create", () => {
263263
toTypename: typeMovie.name,
264264
},
265265
{
266-
id: expect.any(Number),
266+
id: expect.anything(),
267267
id_from: expect.any(Number),
268268
id_to: expect.any(Number),
269269
timestamp: expect.any(Number),
@@ -355,7 +355,7 @@ describe("Subscriptions connect with create", () => {
355355
expect(plugin.eventList).toEqual(
356356
expect.arrayContaining([
357357
{
358-
id: expect.any(Number),
358+
id: expect.anything(),
359359
id_from: expect.any(Number),
360360
id_to: expect.any(Number),
361361
timestamp: expect.any(Number),
@@ -378,7 +378,7 @@ describe("Subscriptions connect with create", () => {
378378
toTypename: typeMovie.name,
379379
},
380380
{
381-
id: expect.any(Number),
381+
id: expect.anything(),
382382
id_from: expect.any(Number),
383383
id_to: expect.any(Number),
384384
timestamp: expect.any(Number),
@@ -463,7 +463,7 @@ describe("Subscriptions connect with create", () => {
463463
expect(plugin.eventList).toEqual(
464464
expect.arrayContaining([
465465
{
466-
id: expect.any(Number),
466+
id: expect.anything(),
467467
id_from: expect.any(Number),
468468
id_to: expect.any(Number),
469469
timestamp: expect.any(Number),
@@ -487,7 +487,7 @@ describe("Subscriptions connect with create", () => {
487487
toTypename: typeMovie.name,
488488
},
489489
{
490-
id: expect.any(Number),
490+
id: expect.anything(),
491491
id_from: expect.any(Number),
492492
id_to: expect.any(Number),
493493
timestamp: expect.any(Number),
@@ -647,7 +647,7 @@ describe("Subscriptions connect with create", () => {
647647
expect(plugin.eventList).toEqual(
648648
expect.arrayContaining([
649649
{
650-
id: expect.any(Number),
650+
id: expect.anything(),
651651
id_from: expect.any(Number),
652652
id_to: expect.any(Number),
653653
timestamp: expect.any(Number),
@@ -671,7 +671,7 @@ describe("Subscriptions connect with create", () => {
671671
toTypename: typeMovie.name,
672672
},
673673
{
674-
id: expect.any(Number),
674+
id: expect.anything(),
675675
id_from: expect.any(Number),
676676
id_to: expect.any(Number),
677677
timestamp: expect.any(Number),
@@ -694,7 +694,7 @@ describe("Subscriptions connect with create", () => {
694694
toTypename: typeMovie.name,
695695
},
696696
{
697-
id: expect.any(Number),
697+
id: expect.anything(),
698698
id_from: expect.any(Number),
699699
id_to: expect.any(Number),
700700
timestamp: expect.any(Number),
@@ -717,7 +717,7 @@ describe("Subscriptions connect with create", () => {
717717
toTypename: typeMovie.name,
718718
},
719719
{
720-
id: expect.any(Number),
720+
id: expect.anything(),
721721
id_from: expect.any(Number),
722722
id_to: expect.any(Number),
723723
timestamp: expect.any(Number),
@@ -740,7 +740,7 @@ describe("Subscriptions connect with create", () => {
740740
toTypename: typeMovie.name,
741741
},
742742
{
743-
id: expect.any(Number),
743+
id: expect.anything(),
744744
id_from: expect.any(Number),
745745
id_to: expect.any(Number),
746746
timestamp: expect.any(Number),
@@ -764,7 +764,7 @@ describe("Subscriptions connect with create", () => {
764764
toTypename: typeMovie.name,
765765
},
766766
{
767-
id: expect.any(Number),
767+
id: expect.anything(),
768768
id_from: expect.any(Number),
769769
id_to: expect.any(Number),
770770
timestamp: expect.any(Number),
@@ -788,7 +788,7 @@ describe("Subscriptions connect with create", () => {
788788
toTypename: typeMovie.name,
789789
},
790790
{
791-
id: expect.any(Number),
791+
id: expect.anything(),
792792
id_from: expect.any(Number),
793793
id_to: expect.any(Number),
794794
timestamp: expect.any(Number),
@@ -812,7 +812,7 @@ describe("Subscriptions connect with create", () => {
812812
toTypename: typeMovie.name,
813813
},
814814
{
815-
id: expect.any(Number),
815+
id: expect.anything(),
816816
id_from: expect.any(Number),
817817
id_to: expect.any(Number),
818818
timestamp: expect.any(Number),

packages/graphql/tests/integration/subscriptions/create-relationship/delete.int.test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
import { graphql } from "graphql";
2121
import type { Driver, Session } from "neo4j-driver";
22-
import { cleanNodes } from "../../../utils/clean-nodes";
2322
import { Neo4jGraphQL } from "../../../../src";
23+
import { cleanNodes } from "../../../utils/clean-nodes";
2424
import { UniqueType } from "../../../utils/graphql-types";
2525
import { TestSubscriptionsEngine } from "../../../utils/TestSubscriptionsEngine";
2626
import Neo4j from "../../neo4j";
@@ -165,10 +165,11 @@ describe("Subscriptions connect with delete", () => {
165165
});
166166

167167
expect(gqlResult.errors).toBeUndefined();
168+
168169
expect(plugin.eventList).toEqual(
169170
expect.arrayContaining([
170171
{
171-
id: expect.any(Number),
172+
id: expect.anything(),
172173
id_from: expect.any(Number),
173174
id_to: expect.any(Number),
174175
timestamp: expect.any(Number),
@@ -190,7 +191,7 @@ describe("Subscriptions connect with delete", () => {
190191
toTypename: typeMovie.name,
191192
},
192193
{
193-
id: expect.any(Number),
194+
id: expect.anything(),
194195
id_from: expect.any(Number),
195196
id_to: expect.any(Number),
196197
timestamp: expect.any(Number),

0 commit comments

Comments
 (0)