Skip to content
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

Fix for CalVer (4.x) #5965

Merged
merged 4 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/serious-paws-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@neo4j/graphql": patch
---

Add support for CalVer editions of neo4j
22 changes: 0 additions & 22 deletions .github/workflows/pull-request-opened.yml

This file was deleted.

5 changes: 5 additions & 0 deletions packages/graphql/src/classes/Neo4jDatabaseInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ describe("Neo4jDatabaseInfo", () => {
return new Neo4jDatabaseInfo("this_seems_not_valid", "enterprise");
}).toThrow();
});

test("should accept CalVar", () => {
const dbInfo = new Neo4jDatabaseInfo("2025.01.0-aura", "enterprise");
expect(dbInfo).toBeInstanceOf(Neo4jDatabaseInfo);
});
});
2 changes: 2 additions & 0 deletions packages/graphql/src/classes/Neo4jDatabaseInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export class Neo4jDatabaseInfo {
public edition: Neo4jEdition | undefined;

constructor(version: string, edition?: Neo4jEdition) {
// Quick hack to support CalVar
version = version.replace(/\.0([0-9]+)/, ".$1");
this.version = this.toSemVer(version);
this.rawVersion = version;
this.edition = edition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import { graphql } from "graphql";
import type { Driver } from "neo4j-driver";
import { cleanNodes } from "../../../utils/clean-nodes";
import { Neo4jGraphQL } from "../../../../src";
import { cleanNodes } from "../../../utils/clean-nodes";
import { UniqueType } from "../../../utils/graphql-types";
import { TestSubscriptionsEngine } from "../../../utils/TestSubscriptionsEngine";
import Neo4j from "../../neo4j";
Expand Down Expand Up @@ -194,7 +194,7 @@ describe("Subscriptions connect with create", () => {
expect(plugin.eventList).toEqual(
expect.arrayContaining([
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -217,7 +217,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -240,7 +240,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -263,7 +263,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand Down Expand Up @@ -355,7 +355,7 @@ describe("Subscriptions connect with create", () => {
expect(plugin.eventList).toEqual(
expect.arrayContaining([
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -378,7 +378,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand Down Expand Up @@ -463,7 +463,7 @@ describe("Subscriptions connect with create", () => {
expect(plugin.eventList).toEqual(
expect.arrayContaining([
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -487,7 +487,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand Down Expand Up @@ -647,7 +647,7 @@ describe("Subscriptions connect with create", () => {
expect(plugin.eventList).toEqual(
expect.arrayContaining([
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -671,7 +671,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -694,7 +694,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -717,7 +717,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -740,7 +740,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -764,7 +764,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -788,7 +788,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -812,7 +812,7 @@ describe("Subscriptions connect with create", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import { graphql } from "graphql";
import type { Driver, Session } from "neo4j-driver";
import { cleanNodes } from "../../../utils/clean-nodes";
import { Neo4jGraphQL } from "../../../../src";
import { cleanNodes } from "../../../utils/clean-nodes";
import { UniqueType } from "../../../utils/graphql-types";
import { TestSubscriptionsEngine } from "../../../utils/TestSubscriptionsEngine";
import Neo4j from "../../neo4j";
Expand Down Expand Up @@ -165,10 +165,11 @@ describe("Subscriptions connect with delete", () => {
});

expect(gqlResult.errors).toBeUndefined();

expect(plugin.eventList).toEqual(
expect.arrayContaining([
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand All @@ -190,7 +191,7 @@ describe("Subscriptions connect with delete", () => {
toTypename: typeMovie.name,
},
{
id: expect.any(Number),
id: expect.anything(),
id_from: expect.any(Number),
id_to: expect.any(Number),
timestamp: expect.any(Number),
Expand Down
Loading