From 7ab215ed9f4ae4f1d6663aa687452632dc308008 Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 10:37:57 +0000 Subject: [PATCH 01/12] Throw error if no @relationshipProperties directive --- packages/graphql/src/schema/get-nodes.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/graphql/src/schema/get-nodes.ts b/packages/graphql/src/schema/get-nodes.ts index 2e180e1d9e..9e55c35790 100644 --- a/packages/graphql/src/schema/get-nodes.ts +++ b/packages/graphql/src/schema/get-nodes.ts @@ -194,6 +194,14 @@ function getNodes( `Cannot find interface specified in ${definition.name.value}.${relationship.fieldName}` ); } + const relationshipPropertiesDirective = propertiesInterface.directives?.find( + (directive) => directive.name.value === "relationshipProperties" + ); + if (!relationshipPropertiesDirective) { + throw new Error( + `The \`@relationshipProperties\` directive could not be found on the \`${relationship.properties}\` interface` + ); + } relationshipPropertyInterfaceNames.add(relationship.properties); } if (relationship.interface) { From 98c4c1a9c5599513616319205eb8a1ac41276dc0 Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 10:43:37 +0000 Subject: [PATCH 02/12] Int test --- .../require-directive.int.test.ts | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts diff --git a/packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts b/packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts new file mode 100644 index 0000000000..087580f366 --- /dev/null +++ b/packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { Driver } from "neo4j-driver"; +import { gql } from "apollo-server"; +import Neo4j from "../neo4j"; +import { Neo4jGraphQL } from "../../../src/classes"; + +describe("Relationship properties - read", () => { + let driver: Driver; + let neo4j: Neo4j; + + const typeDefs = gql` + type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) + } + + type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) + } + + interface ActedIn { + screenTime: Int! + } + `; + + beforeAll(async () => { + neo4j = new Neo4j(); + driver = await neo4j.getDriver(); + }); + + afterAll(async () => { + await driver.close(); + }); + + test("Projecting node and relationship properties with no arguments", async () => { + const neoSchema = new Neo4jGraphQL({ typeDefs }); + + await expect(neoSchema.getSchema()).rejects.toThrow( + "The `@relationshipProperties` directive could not be found on the `ActedIn` interface" + ); + }); +}); From 20a265db4f7211ba1129be2e705465f6f0fe9e7a Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 10:45:09 +0000 Subject: [PATCH 03/12] Extra int test --- .../require-directive.int.test.ts | 60 +++++++++++++------ 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts b/packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts index 087580f366..b20e08eb66 100644 --- a/packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts @@ -26,22 +26,6 @@ describe("Relationship properties - read", () => { let driver: Driver; let neo4j: Neo4j; - const typeDefs = gql` - type Movie { - title: String! - actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) - } - - type Actor { - name: String! - movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) - } - - interface ActedIn { - screenTime: Int! - } - `; - beforeAll(async () => { neo4j = new Neo4j(); driver = await neo4j.getDriver(); @@ -51,11 +35,51 @@ describe("Relationship properties - read", () => { await driver.close(); }); - test("Projecting node and relationship properties with no arguments", async () => { - const neoSchema = new Neo4jGraphQL({ typeDefs }); + test("should throw error if the @relationshipProperties directive is not used", async () => { + const typeDefs = gql` + type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) + } + + type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) + } + + interface ActedIn { + screenTime: Int! + } + `; + + const neoSchema = new Neo4jGraphQL({ typeDefs, driver }); await expect(neoSchema.getSchema()).rejects.toThrow( "The `@relationshipProperties` directive could not be found on the `ActedIn` interface" ); }); + + test("should not throw error if the @relationshipProperties directive is used", async () => { + const typeDefs = gql` + type Movie { + title: String! + actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) + } + + type Actor { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) + } + + interface ActedIn @relationshipProperties { + screenTime: Int! + } + `; + + const neoSchema = new Neo4jGraphQL({ typeDefs, driver }); + + await expect(neoSchema.getSchema()).resolves.not.toThrow( + "The `@relationshipProperties` directive could not be found on the `ActedIn` interface" + ); + }); }); From 43592d36a173109a83231b64ad61f8e117d743df Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 10:59:26 +0000 Subject: [PATCH 04/12] Updated tests --- .../connect-overwrite.int.test.ts | 4 ++-- .../relationship-properties/connect.int.test.ts | 2 +- .../relationship-properties/create.int.test.ts | 2 +- .../relationship-properties/delete.int.test.ts | 2 +- .../relationship-properties/disconnect.int.test.ts | 2 +- ...r-if-missing-relationship-properties.int.test.ts} | 2 +- .../relationship-properties/read.int.test.ts | 2 +- .../relationship-properties/update.int.test.ts | 2 +- .../field-level-aggregations-alias.test.ts | 2 +- .../field-level-aggregations-edge.test.ts | 2 +- .../field-level-aggregations-labels.test.ts | 2 +- .../tests/tck/aggregations/where/edge/bigint.test.ts | 2 +- .../tck/aggregations/where/edge/datetime.test.ts | 2 +- .../tck/aggregations/where/edge/duration.test.ts | 2 +- .../tests/tck/aggregations/where/edge/float.test.ts | 2 +- .../tests/tck/aggregations/where/edge/id.test.ts | 2 +- .../tests/tck/aggregations/where/edge/int.test.ts | 2 +- .../aggregations/where/edge/localdatetime.test.ts | 2 +- .../tck/aggregations/where/edge/localtime.test.ts | 2 +- .../tck/aggregations/where/edge/logical.test.ts | 2 +- .../tests/tck/aggregations/where/edge/string.test.ts | 2 +- .../tests/tck/aggregations/where/edge/time.test.ts | 2 +- packages/graphql/tests/tck/connections/alias.test.ts | 2 +- .../connect-or-create/connect-or-create.test.ts | 6 +++--- .../tck/connections/filtering/composite.test.ts | 2 +- .../tests/tck/connections/filtering/node/and.test.ts | 2 +- .../tck/connections/filtering/node/arrays.test.ts | 2 +- .../tck/connections/filtering/node/equality.test.ts | 2 +- .../tck/connections/filtering/node/numerical.test.ts | 2 +- .../tests/tck/connections/filtering/node/or.test.ts | 2 +- .../tck/connections/filtering/node/points.test.ts | 2 +- .../tck/connections/filtering/node/string.test.ts | 2 +- .../connections/filtering/relationship/and.test.ts | 2 +- .../filtering/relationship/arrays.test.ts | 2 +- .../filtering/relationship/equality.test.ts | 2 +- .../filtering/relationship/numerical.test.ts | 2 +- .../connections/filtering/relationship/or.test.ts | 2 +- .../filtering/relationship/points.test.ts | 2 +- .../filtering/relationship/string.test.ts | 2 +- .../filtering/relationship/temporal.test.ts | 2 +- .../tests/tck/connections/mixed-nesting.test.ts | 2 +- .../tests/tck/connections/projections/create.test.ts | 2 +- .../tests/tck/connections/projections/update.test.ts | 2 +- .../tck/connections/relationship-properties.test.ts | 2 +- .../relationship_properties/connect.test.ts | 2 +- .../relationship_properties/create.test.ts | 2 +- .../relationship_properties/update.test.ts | 2 +- .../graphql/tests/tck/connections/unions.test.ts | 2 +- packages/graphql/tests/tck/directives/alias.test.ts | 2 +- packages/graphql/tests/tck/issues/1150.test.ts | 2 +- packages/graphql/tests/tck/issues/1221.test.ts | 4 ++-- packages/graphql/tests/tck/issues/1783.test.ts | 2 +- packages/graphql/tests/tck/issues/2670.test.ts | 2 +- packages/graphql/tests/tck/issues/2708.test.ts | 2 +- packages/graphql/tests/tck/issues/2713.test.ts | 2 +- packages/graphql/tests/tck/issues/901.test.ts | 2 +- packages/graphql/tests/tck/issues/988.test.ts | 2 +- packages/graphql/tests/tck/operations/update.test.ts | 2 +- .../graphql/tests/tck/subscriptions/create.test.ts | 12 ++++++------ 59 files changed, 68 insertions(+), 68 deletions(-) rename packages/graphql/tests/integration/relationship-properties/{require-directive.int.test.ts => error-if-missing-relationship-properties.int.test.ts} (97%) diff --git a/packages/graphql/tests/integration/relationship-properties/connect-overwrite.int.test.ts b/packages/graphql/tests/integration/relationship-properties/connect-overwrite.int.test.ts index 18d5bfc539..1e2bcd1014 100644 --- a/packages/graphql/tests/integration/relationship-properties/connect-overwrite.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/connect-overwrite.int.test.ts @@ -70,10 +70,10 @@ describe("Relationship properties - connect with and without `overwrite` argumen directed: [ ${typeMovie.name}!]! @relationship(type: "DIRECTED", properties: "Directed", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } - interface Directed { + interface Directed @relationshipProperties { year: Int! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/connect.int.test.ts b/packages/graphql/tests/integration/relationship-properties/connect.int.test.ts index e05e6d09b4..bb32d33bbf 100644 --- a/packages/graphql/tests/integration/relationship-properties/connect.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/connect.int.test.ts @@ -49,7 +49,7 @@ describe("Relationship properties - connect", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/create.int.test.ts b/packages/graphql/tests/integration/relationship-properties/create.int.test.ts index 46f2dfbfcf..887c026fb8 100644 --- a/packages/graphql/tests/integration/relationship-properties/create.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/create.int.test.ts @@ -49,7 +49,7 @@ describe("Relationship properties - create", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/delete.int.test.ts b/packages/graphql/tests/integration/relationship-properties/delete.int.test.ts index a11aab9553..951108374c 100644 --- a/packages/graphql/tests/integration/relationship-properties/delete.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/delete.int.test.ts @@ -49,7 +49,7 @@ describe("Relationship properties - delete", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/disconnect.int.test.ts b/packages/graphql/tests/integration/relationship-properties/disconnect.int.test.ts index 7276ee3c36..ee54fdd458 100644 --- a/packages/graphql/tests/integration/relationship-properties/disconnect.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/disconnect.int.test.ts @@ -49,7 +49,7 @@ describe("Relationship properties - disconnect", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts b/packages/graphql/tests/integration/relationship-properties/error-if-missing-relationship-properties.int.test.ts similarity index 97% rename from packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts rename to packages/graphql/tests/integration/relationship-properties/error-if-missing-relationship-properties.int.test.ts index b20e08eb66..a38f0dd8f3 100644 --- a/packages/graphql/tests/integration/relationship-properties/require-directive.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/error-if-missing-relationship-properties.int.test.ts @@ -22,7 +22,7 @@ import { gql } from "apollo-server"; import Neo4j from "../neo4j"; import { Neo4jGraphQL } from "../../../src/classes"; -describe("Relationship properties - read", () => { +describe("Throw error if missing @relationshipProperties", () => { let driver: Driver; let neo4j: Neo4j; diff --git a/packages/graphql/tests/integration/relationship-properties/read.int.test.ts b/packages/graphql/tests/integration/relationship-properties/read.int.test.ts index 5805afe743..c141871112 100644 --- a/packages/graphql/tests/integration/relationship-properties/read.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/read.int.test.ts @@ -77,7 +77,7 @@ describe("Relationship properties - read", () => { movies: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/update.int.test.ts b/packages/graphql/tests/integration/relationship-properties/update.int.test.ts index 8d6aadfce6..637b8babea 100644 --- a/packages/graphql/tests/integration/relationship-properties/update.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/update.int.test.ts @@ -39,7 +39,7 @@ describe("Relationship properties - update", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-alias.test.ts b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-alias.test.ts index 7561fb554c..4f796e8c71 100644 --- a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-alias.test.ts +++ b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-alias.test.ts @@ -40,7 +40,7 @@ describe("Field Level Aggregations Alias", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { time: Int @alias(property: "screentime") } `; diff --git a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-edge.test.ts b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-edge.test.ts index a265086fd8..0ac7efa804 100644 --- a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-edge.test.ts +++ b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-edge.test.ts @@ -40,7 +40,7 @@ describe("Field Level Aggregations", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int } `; diff --git a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-labels.test.ts b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-labels.test.ts index 162762f3d8..fffb67c22b 100644 --- a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-labels.test.ts +++ b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-labels.test.ts @@ -40,7 +40,7 @@ describe("Field Level Aggregations Alias", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { time: Int } `; diff --git a/packages/graphql/tests/tck/aggregations/where/edge/bigint.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/bigint.test.ts index 8e219285ea..e2dc0da4a2 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/bigint.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/bigint.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someBigInt: BigInt someBigIntAlias: BigInt @alias(property: "_someBigIntAlias") } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/datetime.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/datetime.test.ts index 600ba57bcb..f194a43035 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/datetime.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/datetime.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someDateTime: DateTime someDateTimeAlias: DateTime @alias(property: "_someDateTimeAlias") } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/duration.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/duration.test.ts index 7f8a64a5aa..cc59a61692 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/duration.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/duration.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with Duration", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someDuration: Duration someDurationAlias: Duration @alias(property: "_someDurationAlias") } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/float.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/float.test.ts index 1ceb932647..284e26847c 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/float.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/float.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with Float", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someFloat: Float someFloatAlias: Float @alias(property: "_someFloatAlias") } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/id.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/id.test.ts index fa8ebcdda2..a5be12c45f 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/id.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/id.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with ID", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Liked") } - interface Liked { + interface Liked @relationshipProperties { id: ID someIdAlias: ID @alias(property: "_someIdAlias") } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/int.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/int.test.ts index bccf59be0f..59c0ece4f2 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/int.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/int.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with Int", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Liked") } - interface Liked { + interface Liked @relationshipProperties { someInt: Int someIntAlias: Int @alias(property: "_someIntAlias") } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/localdatetime.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/localdatetime.test.ts index a33bcac953..94d97d27fc 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/localdatetime.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/localdatetime.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someLocalDateTime: LocalDateTime someLocalDateTimeAlias: LocalDateTime @alias(property: "_someLocalDateTimeAlias") } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/localtime.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/localtime.test.ts index ed9ca6e711..d01d69fe3e 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/localtime.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/localtime.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someLocalTime: LocalTime someLocalTimeAlias: LocalTime @alias(property: "_someLocalTimeAlias") } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/logical.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/logical.test.ts index 68aa6d9bac..2d7fc0301c 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/logical.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/logical.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with Logical AND + OR + NOT", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someFloat: Float } `; diff --git a/packages/graphql/tests/tck/aggregations/where/edge/string.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/string.test.ts index b3b484ec04..affb7e4bc0 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/string.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/string.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with String", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someString: String someStringAlias: String @alias(property: "_someStringAlias") } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/time.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/time.test.ts index af1d1b06bc..0e931e13f0 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/time.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/time.test.ts @@ -38,7 +38,7 @@ describe("Cypher Aggregations where edge with Time", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someTime: Time someTimeAlias: Time @alias(property: "_someTimeAlias") } diff --git a/packages/graphql/tests/tck/connections/alias.test.ts b/packages/graphql/tests/tck/connections/alias.test.ts index b2b3d261b3..ba8d0d4bee 100644 --- a/packages/graphql/tests/tck/connections/alias.test.ts +++ b/packages/graphql/tests/tck/connections/alias.test.ts @@ -39,7 +39,7 @@ describe("Connections Alias", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/connect-or-create/connect-or-create.test.ts b/packages/graphql/tests/tck/connections/connect-or-create/connect-or-create.test.ts index b7f10bd77f..80d4c243fc 100644 --- a/packages/graphql/tests/tck/connections/connect-or-create/connect-or-create.test.ts +++ b/packages/graphql/tests/tck/connections/connect-or-create/connect-or-create.test.ts @@ -42,7 +42,7 @@ describe("Create or Connect", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int! } `; @@ -201,7 +201,7 @@ describe("Create or Connect", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int! } `; @@ -487,7 +487,7 @@ describe("Create or Connect", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { id: ID! @id createdAt: DateTime! @timestamp(operations: [CREATE]) updatedAt: DateTime! @timestamp(operations: [UPDATE]) diff --git a/packages/graphql/tests/tck/connections/filtering/composite.test.ts b/packages/graphql/tests/tck/connections/filtering/composite.test.ts index 3ae152938c..c9c94393c9 100644 --- a/packages/graphql/tests/tck/connections/filtering/composite.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/composite.test.ts @@ -42,7 +42,7 @@ describe("Cypher -> Connections -> Filtering -> Composite", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/filtering/node/and.test.ts b/packages/graphql/tests/tck/connections/filtering/node/and.test.ts index 6d2cd64fb6..765745ce58 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/and.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/and.test.ts @@ -42,7 +42,7 @@ describe("Cypher -> Connections -> Filtering -> Node -> AND", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/filtering/node/arrays.test.ts b/packages/graphql/tests/tck/connections/filtering/node/arrays.test.ts index f1e30b7285..fae90a3aac 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/arrays.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/arrays.test.ts @@ -42,7 +42,7 @@ describe("Cypher -> Connections -> Filtering -> Node -> Arrays", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/filtering/node/equality.test.ts b/packages/graphql/tests/tck/connections/filtering/node/equality.test.ts index 6bc357d4bd..759403eaa9 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/equality.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/equality.test.ts @@ -41,7 +41,7 @@ describe("Cypher -> Connections -> Filtering -> Node -> Equality", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/filtering/node/numerical.test.ts b/packages/graphql/tests/tck/connections/filtering/node/numerical.test.ts index d3407ea776..1e8b72e943 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/numerical.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/numerical.test.ts @@ -42,7 +42,7 @@ describe("Cypher -> Connections -> Filtering -> Node -> Numerical", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/filtering/node/or.test.ts b/packages/graphql/tests/tck/connections/filtering/node/or.test.ts index 40c7d5cd92..7378092a93 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/or.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/or.test.ts @@ -42,7 +42,7 @@ describe("Cypher -> Connections -> Filtering -> Node -> OR", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/filtering/node/points.test.ts b/packages/graphql/tests/tck/connections/filtering/node/points.test.ts index 7ff844445c..7a829a8b5a 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/points.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/points.test.ts @@ -42,7 +42,7 @@ describe("Cypher -> Connections -> Filtering -> Node -> Points", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/filtering/node/string.test.ts b/packages/graphql/tests/tck/connections/filtering/node/string.test.ts index fbfb23ed75..af4888acd1 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/string.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/string.test.ts @@ -47,7 +47,7 @@ describe("Cypher -> Connections -> Filtering -> Node -> String", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/and.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/and.test.ts index 058492d80a..28c931cdfe 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/and.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/and.test.ts @@ -41,7 +41,7 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> AND", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { role: String! screenTime: Int! } diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/arrays.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/arrays.test.ts index a7437c1c3c..f6edebbbc1 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/arrays.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/arrays.test.ts @@ -41,7 +41,7 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Arrays", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! quotes: [String!] } diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/equality.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/equality.test.ts index f0d039eeee..a824991091 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/equality.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/equality.test.ts @@ -41,7 +41,7 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Equality", () => movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/numerical.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/numerical.test.ts index 7b8b9611b5..4942a8d9ac 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/numerical.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/numerical.test.ts @@ -41,7 +41,7 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Numerical", () = movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/or.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/or.test.ts index f80f83394a..7586645f29 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/or.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/or.test.ts @@ -41,7 +41,7 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> OR", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { role: String! screenTime: Int! } diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/points.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/points.test.ts index 314d70934d..88e70e6f17 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/points.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/points.test.ts @@ -41,7 +41,7 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Points", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! location: Point! } diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/string.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/string.test.ts index e38052e440..b411d34151 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/string.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/string.test.ts @@ -47,7 +47,7 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> String", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { role: String! screenTime: Int! } diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/temporal.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/temporal.test.ts index f36c3ff262..37909d532f 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/temporal.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/temporal.test.ts @@ -41,7 +41,7 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Temporal", () => movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { startDate: Date endDateTime: DateTime } diff --git a/packages/graphql/tests/tck/connections/mixed-nesting.test.ts b/packages/graphql/tests/tck/connections/mixed-nesting.test.ts index abc55bd8fb..a119719ae0 100644 --- a/packages/graphql/tests/tck/connections/mixed-nesting.test.ts +++ b/packages/graphql/tests/tck/connections/mixed-nesting.test.ts @@ -39,7 +39,7 @@ describe("Mixed nesting", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/projections/create.test.ts b/packages/graphql/tests/tck/connections/projections/create.test.ts index efdad53c07..23b1f8da24 100644 --- a/packages/graphql/tests/tck/connections/projections/create.test.ts +++ b/packages/graphql/tests/tck/connections/projections/create.test.ts @@ -41,7 +41,7 @@ describe("Cypher -> Connections -> Projections -> Create", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/projections/update.test.ts b/packages/graphql/tests/tck/connections/projections/update.test.ts index 845eef2986..cb9df05771 100644 --- a/packages/graphql/tests/tck/connections/projections/update.test.ts +++ b/packages/graphql/tests/tck/connections/projections/update.test.ts @@ -41,7 +41,7 @@ describe("Cypher -> Connections -> Projections -> Update", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/relationship-properties.test.ts b/packages/graphql/tests/tck/connections/relationship-properties.test.ts index 1847aed00e..1fd5c96d5a 100644 --- a/packages/graphql/tests/tck/connections/relationship-properties.test.ts +++ b/packages/graphql/tests/tck/connections/relationship-properties.test.ts @@ -39,7 +39,7 @@ describe("Relationship Properties Cypher", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! year: Int! } diff --git a/packages/graphql/tests/tck/connections/relationship_properties/connect.test.ts b/packages/graphql/tests/tck/connections/relationship_properties/connect.test.ts index 519a7627bb..219c8ba082 100644 --- a/packages/graphql/tests/tck/connections/relationship_properties/connect.test.ts +++ b/packages/graphql/tests/tck/connections/relationship_properties/connect.test.ts @@ -41,7 +41,7 @@ describe("Relationship Properties Connect Cypher", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/relationship_properties/create.test.ts b/packages/graphql/tests/tck/connections/relationship_properties/create.test.ts index d253dd0a07..1fdacdb131 100644 --- a/packages/graphql/tests/tck/connections/relationship_properties/create.test.ts +++ b/packages/graphql/tests/tck/connections/relationship_properties/create.test.ts @@ -41,7 +41,7 @@ describe("Relationship Properties Create Cypher", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/relationship_properties/update.test.ts b/packages/graphql/tests/tck/connections/relationship_properties/update.test.ts index 0441129cfb..3ccc1b78ae 100644 --- a/packages/graphql/tests/tck/connections/relationship_properties/update.test.ts +++ b/packages/graphql/tests/tck/connections/relationship_properties/update.test.ts @@ -39,7 +39,7 @@ describe("Cypher -> Connections -> Relationship Properties -> Update", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/tck/connections/unions.test.ts b/packages/graphql/tests/tck/connections/unions.test.ts index 1cd0d9dd7b..38c35d7d18 100644 --- a/packages/graphql/tests/tck/connections/unions.test.ts +++ b/packages/graphql/tests/tck/connections/unions.test.ts @@ -46,7 +46,7 @@ describe("Cypher -> Connections -> Unions", () => { author: [Author!]! @relationship(type: "WROTE", direction: IN, properties: "Wrote") } - interface Wrote { + interface Wrote @relationshipProperties { words: Int! } `; diff --git a/packages/graphql/tests/tck/directives/alias.test.ts b/packages/graphql/tests/tck/directives/alias.test.ts index 5ffac9a7cf..6f15615263 100644 --- a/packages/graphql/tests/tck/directives/alias.test.ts +++ b/packages/graphql/tests/tck/directives/alias.test.ts @@ -40,7 +40,7 @@ describe("Cypher alias directive", () => { rating: Float @alias(property: "ratingPropInDb") } - interface ActorActedInProps { + interface ActorActedInProps @relationshipProperties { character: String! @alias(property: "characterPropInDb") screenTime: Int } diff --git a/packages/graphql/tests/tck/issues/1150.test.ts b/packages/graphql/tests/tck/issues/1150.test.ts index c34e777931..eb4d12c708 100644 --- a/packages/graphql/tests/tck/issues/1150.test.ts +++ b/packages/graphql/tests/tck/issues/1150.test.ts @@ -56,7 +56,7 @@ describe("https://github.com/neo4j/graphql/issues/1150", () => { @relationship(type: "HAS", properties: "RelationProps", direction: OUT) } - interface RelationProps { + interface RelationProps @relationshipProperties { current: Boolean! } `; diff --git a/packages/graphql/tests/tck/issues/1221.test.ts b/packages/graphql/tests/tck/issues/1221.test.ts index a3422e0e48..3a278eb0ba 100644 --- a/packages/graphql/tests/tck/issues/1221.test.ts +++ b/packages/graphql/tests/tck/issues/1221.test.ts @@ -39,7 +39,7 @@ describe("https://github.com/neo4j/graphql/issues/1221", () => { fullName: String! } - interface RelationProps { + interface RelationProps @relationshipProperties { current: Boolean! } @@ -137,7 +137,7 @@ describe("https://github.com/neo4j/graphql/issues/1221", () => { fullName: String! } - interface RelationProps { + interface RelationProps @relationshipProperties { current: Boolean! } diff --git a/packages/graphql/tests/tck/issues/1783.test.ts b/packages/graphql/tests/tck/issues/1783.test.ts index 030b26783e..36119fc29a 100644 --- a/packages/graphql/tests/tck/issues/1783.test.ts +++ b/packages/graphql/tests/tck/issues/1783.test.ts @@ -40,7 +40,7 @@ describe("https://github.com/neo4j/graphql/issues/1783", () => { fullName: String! } - interface RelationProps { + interface RelationProps @relationshipProperties { current: Boolean! } diff --git a/packages/graphql/tests/tck/issues/2670.test.ts b/packages/graphql/tests/tck/issues/2670.test.ts index 13c8c4b610..7d36995c10 100644 --- a/packages/graphql/tests/tck/issues/2670.test.ts +++ b/packages/graphql/tests/tck/issues/2670.test.ts @@ -41,7 +41,7 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "InGenre") } - interface InGenre { + interface InGenre @relationshipProperties { intValue: Int! } `; diff --git a/packages/graphql/tests/tck/issues/2708.test.ts b/packages/graphql/tests/tck/issues/2708.test.ts index 048ddfbb57..28fadf8669 100644 --- a/packages/graphql/tests/tck/issues/2708.test.ts +++ b/packages/graphql/tests/tck/issues/2708.test.ts @@ -41,7 +41,7 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "InGenre") } - interface InGenre { + interface InGenre @relationshipProperties { intValue: Int! } `; diff --git a/packages/graphql/tests/tck/issues/2713.test.ts b/packages/graphql/tests/tck/issues/2713.test.ts index e8e850fc52..bee0da12f6 100644 --- a/packages/graphql/tests/tck/issues/2713.test.ts +++ b/packages/graphql/tests/tck/issues/2713.test.ts @@ -41,7 +41,7 @@ describe("https://github.com/neo4j/graphql/issues/2713", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "InGenre") } - interface InGenre { + interface InGenre @relationshipProperties { intValue: Int! } `; diff --git a/packages/graphql/tests/tck/issues/901.test.ts b/packages/graphql/tests/tck/issues/901.test.ts index 03c784b704..28ff0fbae6 100644 --- a/packages/graphql/tests/tck/issues/901.test.ts +++ b/packages/graphql/tests/tck/issues/901.test.ts @@ -36,7 +36,7 @@ describe("https://github.com/neo4j/graphql/issues/901", () => { manufacturer: Series @relationship(type: "HAS_MANUFACTURER", direction: OUT, properties: "Properties") } - interface Properties { + interface Properties @relationshipProperties { current: Boolean } `; diff --git a/packages/graphql/tests/tck/issues/988.test.ts b/packages/graphql/tests/tck/issues/988.test.ts index 959a34976a..41b2520534 100644 --- a/packages/graphql/tests/tck/issues/988.test.ts +++ b/packages/graphql/tests/tck/issues/988.test.ts @@ -47,7 +47,7 @@ describe("https://github.com/neo4j/graphql/issues/988", () => { current: Boolean! } - interface RelationProps { + interface RelationProps @relationshipProperties { current: Boolean! } `; diff --git a/packages/graphql/tests/tck/operations/update.test.ts b/packages/graphql/tests/tck/operations/update.test.ts index bc36d94120..6d7b57c002 100644 --- a/packages/graphql/tests/tck/operations/update.test.ts +++ b/packages/graphql/tests/tck/operations/update.test.ts @@ -40,7 +40,7 @@ describe("Cypher Update", () => { actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int } `; diff --git a/packages/graphql/tests/tck/subscriptions/create.test.ts b/packages/graphql/tests/tck/subscriptions/create.test.ts index 8181350c22..e066db3e60 100644 --- a/packages/graphql/tests/tck/subscriptions/create.test.ts +++ b/packages/graphql/tests/tck/subscriptions/create.test.ts @@ -64,7 +64,7 @@ describe("Subscriptions metadata on create", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; @@ -241,7 +241,7 @@ describe("Subscriptions metadata on create", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; @@ -361,11 +361,11 @@ describe("Subscriptions metadata on create", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } - interface Directed { + interface Directed @relationshipProperties { year: Int! } @@ -490,11 +490,11 @@ describe("Subscriptions metadata on create", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } - interface Directed { + interface Directed @relationshipProperties { year: Int! } From 7882312d6c1450cc21c44064f9bead8e36ba8d38 Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 11:29:58 +0000 Subject: [PATCH 05/12] Updated tests --- .../advanced-filtering.int.test.ts | 6 ++--- ...vel-aggregations-graphql-alias.int.test.ts | 2 +- .../field-level-aggregations.int.test.ts | 2 +- ...ested-field-level-aggregations.int.test.ts | 2 +- .../where/field-aggregation-where.int.test.ts | 2 +- .../where/edge/bigint.int.test.ts | 10 +++---- .../where/edge/datetime.int.test.ts | 10 +++---- .../where/edge/duration.int.test.ts | 2 +- .../aggregations/where/edge/float.int.test.ts | 10 +++---- .../aggregations/where/edge/id.int.test.ts | 2 +- .../aggregations/where/edge/int.int.test.ts | 14 +++++----- .../where/edge/string.int.test.ts | 26 +++++++++---------- .../mutations/update/connect-arg.int.test.ts | 4 +-- .../update/disconnect-arg.int.test.ts | 4 +-- .../mutations/update/update-arg.int.test.ts | 2 +- .../integration/composite-where.int.test.ts | 4 +-- .../create-connect-or-create.int.test.ts | 2 +- ...te-connect-or-create-top-level.int.test.ts | 2 +- .../update-connect-or-create.int.test.ts | 2 +- .../connection-resolvers-int.test.ts | 4 +-- .../integration/connections/alias.int.test.ts | 6 ++--- .../integration/connections/enums.int.test.ts | 2 +- .../connections/nested.int.test.ts | 2 +- .../connections/unions.int.test.ts | 2 +- ...c-autogenerated-properties-rel.int.test.ts | 16 ++++++------ .../integration/directives/alias.int.test.ts | 2 +- .../integration/directives/id.int.test.ts | 2 +- .../directives/populatedBy.int.test.ts | 16 ++++++------ .../directives/timestamp/datetime.int.test.ts | 12 ++++----- .../directives/timestamp/time.int.test.ts | 12 ++++----- .../tests/integration/issues/1150.int.test.ts | 2 +- .../tests/integration/issues/1221.int.test.ts | 2 +- .../tests/integration/issues/1782.int.test.ts | 2 +- .../tests/integration/issues/1783.int.test.ts | 2 +- .../tests/integration/issues/2249.int.test.ts | 2 +- .../tests/integration/issues/2662.int.test.ts | 4 +-- .../tests/integration/issues/2669.int.test.ts | 2 +- .../tests/integration/issues/2670.int.test.ts | 2 +- .../tests/integration/issues/2708.int.test.ts | 2 +- .../tests/integration/issues/2713.int.test.ts | 2 +- .../tests/integration/issues/369.int.test.ts | 4 +-- .../tests/integration/issues/988.int.test.ts | 2 +- .../connect-overwrite.int.test.ts | 6 ++--- .../connect.int.test.ts | 6 ++--- .../create.int.test.ts | 2 +- .../delete.int.test.ts | 2 +- .../disconnect.int.test.ts | 2 +- .../create-relationship/create.int.test.ts | 2 +- .../create-relationship/delete.int.test.ts | 2 +- .../create/connect-or-create.int.test.ts | 2 +- 50 files changed, 118 insertions(+), 118 deletions(-) diff --git a/packages/graphql/tests/integration/advanced-filtering.int.test.ts b/packages/graphql/tests/integration/advanced-filtering.int.test.ts index e2bc664924..ea1253a610 100644 --- a/packages/graphql/tests/integration/advanced-filtering.int.test.ts +++ b/packages/graphql/tests/integration/advanced-filtering.int.test.ts @@ -1617,7 +1617,7 @@ describe("Advanced Filtering", () => { id: ID } - interface ActedIn { + interface ActedIn @relationshipProperties { id: String } `; @@ -1684,7 +1684,7 @@ describe("Advanced Filtering", () => { id: ID } - interface ActedIn { + interface ActedIn @relationshipProperties { id: String } `; @@ -1904,7 +1904,7 @@ describe("Advanced Filtering", () => { id: ID } - interface ActedIn { + interface ActedIn @relationshipProperties { id: ID } `; diff --git a/packages/graphql/tests/integration/aggregations/field-level/field-level-aggregations-graphql-alias.int.test.ts b/packages/graphql/tests/integration/aggregations/field-level/field-level-aggregations-graphql-alias.int.test.ts index 4e8049a632..e5849c2f9d 100644 --- a/packages/graphql/tests/integration/aggregations/field-level/field-level-aggregations-graphql-alias.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/field-level/field-level-aggregations-graphql-alias.int.test.ts @@ -51,7 +51,7 @@ describe("Field Level Aggregations Graphql alias", () => { ${typeMovie.plural}: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", direction: OUT, properties:"ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int character: String } diff --git a/packages/graphql/tests/integration/aggregations/field-level/field-level-aggregations.int.test.ts b/packages/graphql/tests/integration/aggregations/field-level/field-level-aggregations.int.test.ts index 223ec6a51d..d45f5376bf 100644 --- a/packages/graphql/tests/integration/aggregations/field-level/field-level-aggregations.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/field-level/field-level-aggregations.int.test.ts @@ -51,7 +51,7 @@ describe("Field Level Aggregations", () => { ${typeMovie.plural}: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", direction: OUT, properties:"ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int character: String } diff --git a/packages/graphql/tests/integration/aggregations/field-level/nested-field-level-aggregations.int.test.ts b/packages/graphql/tests/integration/aggregations/field-level/nested-field-level-aggregations.int.test.ts index 76cc84ec42..98381d041a 100644 --- a/packages/graphql/tests/integration/aggregations/field-level/nested-field-level-aggregations.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/field-level/nested-field-level-aggregations.int.test.ts @@ -51,7 +51,7 @@ describe("Nested Field Level Aggregations", () => { ${typeMovie.plural}: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", direction: OUT, properties:"ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int character: String } diff --git a/packages/graphql/tests/integration/aggregations/field-level/where/field-aggregation-where.int.test.ts b/packages/graphql/tests/integration/aggregations/field-level/where/field-aggregation-where.int.test.ts index 3aea1d23fd..aa05112e22 100644 --- a/packages/graphql/tests/integration/aggregations/field-level/where/field-aggregation-where.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/field-level/where/field-aggregation-where.int.test.ts @@ -51,7 +51,7 @@ describe("Field Level Aggregations Where", () => { movies: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", direction: OUT, properties:"ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int character: String } diff --git a/packages/graphql/tests/integration/aggregations/where/edge/bigint.int.test.ts b/packages/graphql/tests/integration/aggregations/where/edge/bigint.int.test.ts index 3ae7ac5a7e..eb1ff197c8 100644 --- a/packages/graphql/tests/integration/aggregations/where/edge/bigint.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/edge/bigint.int.test.ts @@ -51,7 +51,7 @@ describe("aggregations-where-edge-bigint", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someBigInt: BigInt } `; @@ -118,7 +118,7 @@ describe("aggregations-where-edge-bigint", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someBigInt: BigInt } `; @@ -188,7 +188,7 @@ describe("aggregations-where-edge-bigint", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someBigInt: BigInt } `; @@ -255,7 +255,7 @@ describe("aggregations-where-edge-bigint", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someBigInt: BigInt } `; @@ -324,7 +324,7 @@ describe("aggregations-where-edge-bigint", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someBigInt: BigInt } `; diff --git a/packages/graphql/tests/integration/aggregations/where/edge/datetime.int.test.ts b/packages/graphql/tests/integration/aggregations/where/edge/datetime.int.test.ts index 84b316d2e4..16ba8e3a71 100644 --- a/packages/graphql/tests/integration/aggregations/where/edge/datetime.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/edge/datetime.int.test.ts @@ -49,7 +49,7 @@ describe("aggregations-where-edge-datetime", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someDateTime: DateTime } `; @@ -118,7 +118,7 @@ describe("aggregations-where-edge-datetime", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someDateTime: DateTime } `; @@ -189,7 +189,7 @@ describe("aggregations-where-edge-datetime", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someDateTime: DateTime } `; @@ -258,7 +258,7 @@ describe("aggregations-where-edge-datetime", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someDateTime: DateTime } `; @@ -329,7 +329,7 @@ describe("aggregations-where-edge-datetime", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someDateTime: DateTime } `; diff --git a/packages/graphql/tests/integration/aggregations/where/edge/duration.int.test.ts b/packages/graphql/tests/integration/aggregations/where/edge/duration.int.test.ts index 069dc30c06..c6424195cd 100644 --- a/packages/graphql/tests/integration/aggregations/where/edge/duration.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/edge/duration.int.test.ts @@ -49,7 +49,7 @@ describe("aggregations-where-edge-duration", () => { likes: [${User}!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someDuration: Duration! } `; diff --git a/packages/graphql/tests/integration/aggregations/where/edge/float.int.test.ts b/packages/graphql/tests/integration/aggregations/where/edge/float.int.test.ts index 362b078216..28afe4909f 100644 --- a/packages/graphql/tests/integration/aggregations/where/edge/float.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/edge/float.int.test.ts @@ -49,7 +49,7 @@ describe("aggregations-where-edge-float", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someFloat: Float } `; @@ -118,7 +118,7 @@ describe("aggregations-where-edge-float", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someFloat: Float } `; @@ -188,7 +188,7 @@ describe("aggregations-where-edge-float", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someFloat: Float } `; @@ -257,7 +257,7 @@ describe("aggregations-where-edge-float", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someFloat: Float } `; @@ -327,7 +327,7 @@ describe("aggregations-where-edge-float", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someFloat: Float } `; diff --git a/packages/graphql/tests/integration/aggregations/where/edge/id.int.test.ts b/packages/graphql/tests/integration/aggregations/where/edge/id.int.test.ts index 3b533c453b..11e02bd7ee 100644 --- a/packages/graphql/tests/integration/aggregations/where/edge/id.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/edge/id.int.test.ts @@ -49,7 +49,7 @@ describe("aggregations-where-edge-id", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testId: ID } `; diff --git a/packages/graphql/tests/integration/aggregations/where/edge/int.int.test.ts b/packages/graphql/tests/integration/aggregations/where/edge/int.int.test.ts index af0b12179f..7dfa526b8d 100644 --- a/packages/graphql/tests/integration/aggregations/where/edge/int.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/edge/int.int.test.ts @@ -50,7 +50,7 @@ describe("aggregations-where-edge-int", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someInt: Int } `; @@ -115,7 +115,7 @@ describe("aggregations-where-edge-int", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someInt: Int } `; @@ -182,7 +182,7 @@ describe("aggregations-where-edge-int", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someInt: Int } `; @@ -248,7 +248,7 @@ describe("aggregations-where-edge-int", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someInt: Int } `; @@ -314,7 +314,7 @@ describe("aggregations-where-edge-int", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someInt: Int } `; @@ -377,7 +377,7 @@ describe("aggregations-where-edge-int", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someInt: Int } `; @@ -652,7 +652,7 @@ describe("aggregations-where-edge-int", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someInt: Int } `; diff --git a/packages/graphql/tests/integration/aggregations/where/edge/string.int.test.ts b/packages/graphql/tests/integration/aggregations/where/edge/string.int.test.ts index 40d8372a30..8aa6931f03 100644 --- a/packages/graphql/tests/integration/aggregations/where/edge/string.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/edge/string.int.test.ts @@ -51,7 +51,7 @@ describe("aggregations-where-edge-string", () => { someStringAlias: String @alias(property: "_someStringAlias") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -118,7 +118,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -189,7 +189,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -259,7 +259,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -329,7 +329,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -402,7 +402,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -493,7 +493,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -584,7 +584,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -672,7 +672,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -760,7 +760,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -847,7 +847,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -935,7 +935,7 @@ describe("aggregations-where-edge-string", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { testString: String } `; @@ -1024,7 +1024,7 @@ describe("aggregations-where-edge-string", () => { content: String likes: [${User}!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someStringAlias: String @alias(property: "_someStringAlias") } `; diff --git a/packages/graphql/tests/integration/aggregations/where/mutations/update/connect-arg.int.test.ts b/packages/graphql/tests/integration/aggregations/where/mutations/update/connect-arg.int.test.ts index 904607b89e..ff522ca9ad 100644 --- a/packages/graphql/tests/integration/aggregations/where/mutations/update/connect-arg.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/mutations/update/connect-arg.int.test.ts @@ -65,7 +65,7 @@ describe("Connect using aggregate where", () => { likes: [${userType.name}!]! @relationship(type: "LIKES", direction: IN, properties: "${likeInterface.name}") } - interface ${likeInterface.name} { + interface ${likeInterface.name} @relationshipProperties { likedAt: DateTime } `; @@ -396,7 +396,7 @@ describe("Connect UNIONs using aggregate where", () => { likes: [${userUnion.name}!]! @relationship(type: "LIKES", direction: IN, properties: "${likeInterface.name}") } - interface ${likeInterface.name} { + interface ${likeInterface.name} @relationshipProperties { likedAt: DateTime } `; diff --git a/packages/graphql/tests/integration/aggregations/where/mutations/update/disconnect-arg.int.test.ts b/packages/graphql/tests/integration/aggregations/where/mutations/update/disconnect-arg.int.test.ts index 3d7f88941a..e390be1cea 100644 --- a/packages/graphql/tests/integration/aggregations/where/mutations/update/disconnect-arg.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/mutations/update/disconnect-arg.int.test.ts @@ -63,7 +63,7 @@ describe("Disconnect using aggregate where", () => { likes: [${userType.name}!]! @relationship(type: "LIKES", direction: IN, properties: "${likeInterface.name}") } - interface ${likeInterface.name} { + interface ${likeInterface.name} @relationshipProperties { likedAt: DateTime } `; @@ -315,7 +315,7 @@ describe("Disconnect UNIONs using aggregate where", () => { likes: [${userUnion.name}!]! @relationship(type: "LIKES", direction: IN, properties: "${likeInterface.name}") } - interface ${likeInterface.name} { + interface ${likeInterface.name} @relationshipProperties { likedAt: DateTime } `; diff --git a/packages/graphql/tests/integration/aggregations/where/mutations/update/update-arg.int.test.ts b/packages/graphql/tests/integration/aggregations/where/mutations/update/update-arg.int.test.ts index e0a785a93c..c12ea66339 100644 --- a/packages/graphql/tests/integration/aggregations/where/mutations/update/update-arg.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/mutations/update/update-arg.int.test.ts @@ -65,7 +65,7 @@ describe("Update using aggregate where", () => { likes: [${userType.name}!]! @relationship(type: "LIKES", direction: IN, properties: "${likeInterface.name}") } - interface ${likeInterface.name} { + interface ${likeInterface.name} @relationshipProperties { likedAt: DateTime } `; diff --git a/packages/graphql/tests/integration/composite-where.int.test.ts b/packages/graphql/tests/integration/composite-where.int.test.ts index 0ec2b8a0e8..076bdb888a 100644 --- a/packages/graphql/tests/integration/composite-where.int.test.ts +++ b/packages/graphql/tests/integration/composite-where.int.test.ts @@ -50,7 +50,7 @@ describe("composite-where", () => { actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int } `; @@ -139,7 +139,7 @@ describe("composite-where", () => { actors: [Actor!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: IN) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int } `; diff --git a/packages/graphql/tests/integration/connect-or-create/create-connect-or-create.int.test.ts b/packages/graphql/tests/integration/connect-or-create/create-connect-or-create.int.test.ts index 96b0e37424..52f6f16eb2 100644 --- a/packages/graphql/tests/integration/connect-or-create/create-connect-or-create.int.test.ts +++ b/packages/graphql/tests/integration/connect-or-create/create-connect-or-create.int.test.ts @@ -54,7 +54,7 @@ describe("Create -> ConnectOrCreate", () => { ${typeMovie.plural}: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", direction: OUT, properties:"ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int } `; diff --git a/packages/graphql/tests/integration/connect-or-create/update-connect-or-create-top-level.int.test.ts b/packages/graphql/tests/integration/connect-or-create/update-connect-or-create-top-level.int.test.ts index 63081ce23f..d7e40bf72f 100644 --- a/packages/graphql/tests/integration/connect-or-create/update-connect-or-create-top-level.int.test.ts +++ b/packages/graphql/tests/integration/connect-or-create/update-connect-or-create-top-level.int.test.ts @@ -53,7 +53,7 @@ describe("Update -> ConnectOrCreate Top Level", () => { ${typeMovie.plural}: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", direction: OUT, properties:"ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int } `; diff --git a/packages/graphql/tests/integration/connect-or-create/update-connect-or-create.int.test.ts b/packages/graphql/tests/integration/connect-or-create/update-connect-or-create.int.test.ts index 677feecd46..49089c6c71 100644 --- a/packages/graphql/tests/integration/connect-or-create/update-connect-or-create.int.test.ts +++ b/packages/graphql/tests/integration/connect-or-create/update-connect-or-create.int.test.ts @@ -53,7 +53,7 @@ describe("Update -> ConnectOrCreate", () => { ${typeMovie.plural}: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", direction: OUT, properties:"ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int } `; diff --git a/packages/graphql/tests/integration/connection-resolvers-int.test.ts b/packages/graphql/tests/integration/connection-resolvers-int.test.ts index b30a88c2c3..f28b6ef67b 100644 --- a/packages/graphql/tests/integration/connection-resolvers-int.test.ts +++ b/packages/graphql/tests/integration/connection-resolvers-int.test.ts @@ -53,7 +53,7 @@ describe("Connection Resolvers", () => { actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; @@ -161,7 +161,7 @@ describe("Connection Resolvers", () => { actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/connections/alias.int.test.ts b/packages/graphql/tests/integration/connections/alias.int.test.ts index 63e9b86b74..67bd9d35aa 100644 --- a/packages/graphql/tests/integration/connections/alias.int.test.ts +++ b/packages/graphql/tests/integration/connections/alias.int.test.ts @@ -723,7 +723,7 @@ describe("Connections Alias", () => { movies: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { roles: [String]! } `; @@ -786,7 +786,7 @@ describe("Connections Alias", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { roles: [String]! } `; @@ -957,7 +957,7 @@ describe("Connections Alias", () => { movies: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/connections/enums.int.test.ts b/packages/graphql/tests/integration/connections/enums.int.test.ts index d05fdfd200..a50549b52e 100644 --- a/packages/graphql/tests/integration/connections/enums.int.test.ts +++ b/packages/graphql/tests/integration/connections/enums.int.test.ts @@ -60,7 +60,7 @@ describe("Enum Relationship Properties", () => { SUPPORTING } - interface ActedIn { + interface ActedIn @relationshipProperties { roleType: RoleType! } `; diff --git a/packages/graphql/tests/integration/connections/nested.int.test.ts b/packages/graphql/tests/integration/connections/nested.int.test.ts index 444b3f0d06..e25af31d98 100644 --- a/packages/graphql/tests/integration/connections/nested.int.test.ts +++ b/packages/graphql/tests/integration/connections/nested.int.test.ts @@ -59,7 +59,7 @@ describe("Connections Alias", () => { movies: [${typeMovie}!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/connections/unions.int.test.ts b/packages/graphql/tests/integration/connections/unions.int.test.ts index b174dcc09c..c22aae4f09 100644 --- a/packages/graphql/tests/integration/connections/unions.int.test.ts +++ b/packages/graphql/tests/integration/connections/unions.int.test.ts @@ -46,7 +46,7 @@ describe("Connections -> Unions", () => { author: [Author!]! @relationship(type: "WROTE", direction: IN, properties: "Wrote") } - interface Wrote { + interface Wrote @relationshipProperties { words: Int! } `; diff --git a/packages/graphql/tests/integration/deprecated/rfc-autogenerated-properties-rel.int.test.ts b/packages/graphql/tests/integration/deprecated/rfc-autogenerated-properties-rel.int.test.ts index 6e81e584ba..35cefa6353 100644 --- a/packages/graphql/tests/integration/deprecated/rfc-autogenerated-properties-rel.int.test.ts +++ b/packages/graphql/tests/integration/deprecated/rfc-autogenerated-properties-rel.int.test.ts @@ -58,7 +58,7 @@ describe("integration/rfc/autogenerate-properties-rel", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: String! @callback(operations: [CREATE], name: "callback") } @@ -168,7 +168,7 @@ describe("integration/rfc/autogenerate-properties-rel", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: String! @callback(operations: [UPDATE], name: "callback") } @@ -296,7 +296,7 @@ describe("integration/rfc/autogenerate-properties-rel", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: String! @callback(operations: [CREATE, UPDATE], name: "callback") } @@ -453,7 +453,7 @@ describe("integration/rfc/autogenerate-properties-rel", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: Int! @callback(operations: [CREATE], name: "callback") } @@ -566,7 +566,7 @@ describe("integration/rfc/autogenerate-properties-rel", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: Int! @callback(operations: [UPDATE], name: "callback") } @@ -700,7 +700,7 @@ describe("integration/rfc/autogenerate-properties-rel", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: Int! @callback(operations: [CREATE, UPDATE], name: "callback") } @@ -850,7 +850,7 @@ describe("integration/rfc/autogenerate-properties-rel", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! title: String! slug: String! @callback(operations: [CREATE], name: "callback") @@ -963,7 +963,7 @@ describe("integration/rfc/autogenerate-properties-rel", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! title: String! slug: String! @callback(operations: [UPDATE], name: "callback") diff --git a/packages/graphql/tests/integration/directives/alias.int.test.ts b/packages/graphql/tests/integration/directives/alias.int.test.ts index 8417c44142..718c5a5ea3 100644 --- a/packages/graphql/tests/integration/directives/alias.int.test.ts +++ b/packages/graphql/tests/integration/directives/alias.int.test.ts @@ -60,7 +60,7 @@ describe("@alias directive", () => { createdAt: DateTime! @timestamp(operations: [CREATE]) @alias(property: "dbCreatedAt") } - interface AliasDirectiveTestLikesProps { + interface AliasDirectiveTestLikesProps @relationshipProperties { comment: String! @alias(property: "dbComment") relationshipCreatedAt: DateTime! @timestamp(operations: [CREATE]) @alias(property: "dbCreatedAt") } diff --git a/packages/graphql/tests/integration/directives/id.int.test.ts b/packages/graphql/tests/integration/directives/id.int.test.ts index 7485358d72..69b18418cb 100644 --- a/packages/graphql/tests/integration/directives/id.int.test.ts +++ b/packages/graphql/tests/integration/directives/id.int.test.ts @@ -192,7 +192,7 @@ describe("@id directive", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { id: ID! @id screenTime: Int! } diff --git a/packages/graphql/tests/integration/directives/populatedBy.int.test.ts b/packages/graphql/tests/integration/directives/populatedBy.int.test.ts index 38898f2943..cc495ea838 100644 --- a/packages/graphql/tests/integration/directives/populatedBy.int.test.ts +++ b/packages/graphql/tests/integration/directives/populatedBy.int.test.ts @@ -829,7 +829,7 @@ describe("@populatedBy directive", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: String! @populatedBy(operations: [CREATE], callback: "callback") } @@ -939,7 +939,7 @@ describe("@populatedBy directive", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: String! @populatedBy(operations: [UPDATE], callback: "callback") } @@ -1067,7 +1067,7 @@ describe("@populatedBy directive", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: String! @populatedBy(operations: [CREATE, UPDATE], callback: "callback") } @@ -1224,7 +1224,7 @@ describe("@populatedBy directive", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: Int! @populatedBy(operations: [CREATE], callback: "callback") } @@ -1337,7 +1337,7 @@ describe("@populatedBy directive", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: Int! @populatedBy(operations: [UPDATE], callback: "callback") } @@ -1471,7 +1471,7 @@ describe("@populatedBy directive", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback: Int! @populatedBy(operations: [CREATE, UPDATE], callback: "callback") } @@ -1621,7 +1621,7 @@ describe("@populatedBy directive", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! title: String! slug: String! @populatedBy(operations: [CREATE], callback: "callback") @@ -1734,7 +1734,7 @@ describe("@populatedBy directive", () => { ) } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! title: String! slug: String! @populatedBy(operations: [UPDATE], callback: "callback") diff --git a/packages/graphql/tests/integration/directives/timestamp/datetime.int.test.ts b/packages/graphql/tests/integration/directives/timestamp/datetime.int.test.ts index 33cd960ef3..2be40b4c99 100644 --- a/packages/graphql/tests/integration/directives/timestamp/datetime.int.test.ts +++ b/packages/graphql/tests/integration/directives/timestamp/datetime.int.test.ts @@ -99,7 +99,7 @@ describe("timestamp/datetime", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { createdAt: DateTime! @timestamp(operations: [CREATE]) screenTime: Int! } @@ -223,7 +223,7 @@ describe("timestamp/datetime", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { updatedAt: DateTime! @timestamp(operations: [UPDATE]) screenTime: Int! } @@ -349,7 +349,7 @@ describe("timestamp/datetime", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { createdAt: DateTime! @timestamp(operations: [CREATE, UPDATE]) screenTime: Int! } @@ -413,7 +413,7 @@ describe("timestamp/datetime", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { updatedAt: DateTime! @timestamp(operations: [CREATE, UPDATE]) screenTime: Int! } @@ -597,7 +597,7 @@ describe("timestamp/datetime", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { createdAt: DateTime! @timestamp screenTime: Int! } @@ -661,7 +661,7 @@ describe("timestamp/datetime", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { updatedAt: DateTime! @timestamp screenTime: Int! } diff --git a/packages/graphql/tests/integration/directives/timestamp/time.int.test.ts b/packages/graphql/tests/integration/directives/timestamp/time.int.test.ts index 7699dc8c82..527afda46f 100644 --- a/packages/graphql/tests/integration/directives/timestamp/time.int.test.ts +++ b/packages/graphql/tests/integration/directives/timestamp/time.int.test.ts @@ -99,7 +99,7 @@ describe("timestamp/time", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { createdAt: Time! @timestamp(operations: [CREATE]) screenTime: Int! } @@ -232,7 +232,7 @@ describe("timestamp/time", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { updatedAt: Time! @timestamp(operations: [UPDATE]) screenTime: Int! } @@ -366,7 +366,7 @@ describe("timestamp/time", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { createdAt: Time! @timestamp(operations: [CREATE, UPDATE]) screenTime: Int! } @@ -442,7 +442,7 @@ describe("timestamp/time", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { updatedAt: Time! @timestamp(operations: [CREATE, UPDATE]) screenTime: Int! } @@ -631,7 +631,7 @@ describe("timestamp/time", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { createdAt: Time! @timestamp screenTime: Int! } @@ -706,7 +706,7 @@ describe("timestamp/time", () => { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { updatedAt: Time! @timestamp screenTime: Int! } diff --git a/packages/graphql/tests/integration/issues/1150.int.test.ts b/packages/graphql/tests/integration/issues/1150.int.test.ts index 99b5ac6472..06823f893b 100644 --- a/packages/graphql/tests/integration/issues/1150.int.test.ts +++ b/packages/graphql/tests/integration/issues/1150.int.test.ts @@ -65,7 +65,7 @@ describe("https://github.com/neo4j/graphql/issues/1150", () => { @relationship(type: "HAS", properties: "RelationProps", direction: OUT) } - interface RelationProps { + interface RelationProps @relationshipProperties { current: Boolean! } `; diff --git a/packages/graphql/tests/integration/issues/1221.int.test.ts b/packages/graphql/tests/integration/issues/1221.int.test.ts index 6851f4380b..414e0535b2 100644 --- a/packages/graphql/tests/integration/issues/1221.int.test.ts +++ b/packages/graphql/tests/integration/issues/1221.int.test.ts @@ -46,7 +46,7 @@ describe("https://github.com/neo4j/graphql/issues/1221", () => { fullName: String! } - interface RelationProps { + interface RelationProps @relationshipProperties { current: Boolean! } diff --git a/packages/graphql/tests/integration/issues/1782.int.test.ts b/packages/graphql/tests/integration/issues/1782.int.test.ts index a86be79a01..13e082770a 100644 --- a/packages/graphql/tests/integration/issues/1782.int.test.ts +++ b/packages/graphql/tests/integration/issues/1782.int.test.ts @@ -48,7 +48,7 @@ describe("https://github.com/neo4j/graphql/issues/1782", () => { fullName: String! } - interface RelationProps { + interface RelationProps @relationshipProperties { current: Boolean! } diff --git a/packages/graphql/tests/integration/issues/1783.int.test.ts b/packages/graphql/tests/integration/issues/1783.int.test.ts index 2e4dff66d0..97ecf4ace5 100644 --- a/packages/graphql/tests/integration/issues/1783.int.test.ts +++ b/packages/graphql/tests/integration/issues/1783.int.test.ts @@ -46,7 +46,7 @@ describe("https://github.com/neo4j/graphql/issues/1783", () => { fullName: String! } - interface RelationProps { + interface RelationProps @relationshipProperties { current: Boolean! } diff --git a/packages/graphql/tests/integration/issues/2249.int.test.ts b/packages/graphql/tests/integration/issues/2249.int.test.ts index 63f6967a41..bd764a20c7 100644 --- a/packages/graphql/tests/integration/issues/2249.int.test.ts +++ b/packages/graphql/tests/integration/issues/2249.int.test.ts @@ -51,7 +51,7 @@ describe("https://github.com/neo4j/graphql/issues/2249", () => { imdbId: Int @unique } - interface Review { + interface Review @relationshipProperties { score: Int! } diff --git a/packages/graphql/tests/integration/issues/2662.int.test.ts b/packages/graphql/tests/integration/issues/2662.int.test.ts index 954b82d583..25c36dec6e 100644 --- a/packages/graphql/tests/integration/issues/2662.int.test.ts +++ b/packages/graphql/tests/integration/issues/2662.int.test.ts @@ -65,7 +65,7 @@ describe("https://github.com/neo4j/graphql/issues/2662", () => { content: String! likes: [${userType}!]! @relationship(type: "LIKES", direction: IN, properties: "${likesInterface}") } - interface ${likesInterface} { + interface ${likesInterface} @relationshipProperties { someString: String } `; @@ -845,7 +845,7 @@ describe("https://github.com/neo4j/graphql/issues/2662", () => { someProperty: Int! likes: [${userType}!]! @relationship(type: "LIKES", direction: IN, properties: "${likesInterface}") } - interface ${likesInterface} { + interface ${likesInterface} @relationshipProperties { someProperty: String! } `; diff --git a/packages/graphql/tests/integration/issues/2669.int.test.ts b/packages/graphql/tests/integration/issues/2669.int.test.ts index e644e59b45..c534bf29fd 100644 --- a/packages/graphql/tests/integration/issues/2669.int.test.ts +++ b/packages/graphql/tests/integration/issues/2669.int.test.ts @@ -50,7 +50,7 @@ describe("https://github.com/neo4j/graphql/issues/2669", () => { movies: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { time: Int @alias(property: "screentime") } `; diff --git a/packages/graphql/tests/integration/issues/2670.int.test.ts b/packages/graphql/tests/integration/issues/2670.int.test.ts index 05a368fcd5..0711a570ab 100644 --- a/packages/graphql/tests/integration/issues/2670.int.test.ts +++ b/packages/graphql/tests/integration/issues/2670.int.test.ts @@ -81,7 +81,7 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { genres: [${genreType.name}!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "${inGenreInterface.name}") } - interface ${inGenreInterface.name} { + interface ${inGenreInterface.name} @relationshipProperties { intValue: Int! } `; diff --git a/packages/graphql/tests/integration/issues/2708.int.test.ts b/packages/graphql/tests/integration/issues/2708.int.test.ts index a2807dc7a4..8d26121583 100644 --- a/packages/graphql/tests/integration/issues/2708.int.test.ts +++ b/packages/graphql/tests/integration/issues/2708.int.test.ts @@ -81,7 +81,7 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { genres: [${genreType.name}!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "${inGenreInterface.name}") } - interface ${inGenreInterface.name} { + interface ${inGenreInterface.name} @relationshipProperties { intValue: Int! } `; diff --git a/packages/graphql/tests/integration/issues/2713.int.test.ts b/packages/graphql/tests/integration/issues/2713.int.test.ts index 7facbd4623..2e3ab98f55 100644 --- a/packages/graphql/tests/integration/issues/2713.int.test.ts +++ b/packages/graphql/tests/integration/issues/2713.int.test.ts @@ -68,7 +68,7 @@ describe("https://github.com/neo4j/graphql/issues/2713", () => { movies: [${movieType.name}!]! @relationship(type: "IN_GENRE", direction: IN, properties: "${inGenreInterface.name}") } - interface ${inGenreInterface.name} { + interface ${inGenreInterface.name} @relationshipProperties { intValue: Int! } `; diff --git a/packages/graphql/tests/integration/issues/369.int.test.ts b/packages/graphql/tests/integration/issues/369.int.test.ts index 2c84ea8fcd..6a53b707e0 100644 --- a/packages/graphql/tests/integration/issues/369.int.test.ts +++ b/packages/graphql/tests/integration/issues/369.int.test.ts @@ -47,7 +47,7 @@ describe("369", () => { dependeFrom: [Dato!]! @relationship(type: "DEPENDE", direction: IN, properties: "Depende") } - interface Depende { + interface Depende @relationshipProperties { uuid: ID } @@ -132,7 +132,7 @@ describe("369", () => { dependeFrom: [Dato!]! @relationship(type: "DEPENDE", direction: IN, properties: "Depende") } - interface Depende { + interface Depende @relationshipProperties { uuid: ID } diff --git a/packages/graphql/tests/integration/issues/988.int.test.ts b/packages/graphql/tests/integration/issues/988.int.test.ts index 6a9f0a8eb8..2a9bf57425 100644 --- a/packages/graphql/tests/integration/issues/988.int.test.ts +++ b/packages/graphql/tests/integration/issues/988.int.test.ts @@ -57,7 +57,7 @@ describe("https://github.com/neo4j/graphql/issues/988", () => { current: Boolean! } - interface RelationProps { + interface RelationProps @relationshipProperties { current: Boolean! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/connect-overwrite.int.test.ts b/packages/graphql/tests/integration/relationship-properties/connect-overwrite.int.test.ts index 1e2bcd1014..26b0724f60 100644 --- a/packages/graphql/tests/integration/relationship-properties/connect-overwrite.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/connect-overwrite.int.test.ts @@ -312,7 +312,7 @@ describe("Relationship properties - connect with and without `overwrite` argumen movies: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; @@ -709,7 +709,7 @@ describe("Relationship properties - connect with and without `overwrite` argumen movies: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; @@ -1352,7 +1352,7 @@ describe("Relationship properties - connect with and without `overwrite` argumen directed: [${typeMovie.name}!]! @relationship(type: "DIRECTED", properties: "Directed", direction: OUT) } - interface Directed { + interface Directed @relationshipProperties { year: Int! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/connect.int.test.ts b/packages/graphql/tests/integration/relationship-properties/connect.int.test.ts index bb32d33bbf..292579e866 100644 --- a/packages/graphql/tests/integration/relationship-properties/connect.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/connect.int.test.ts @@ -147,7 +147,7 @@ describe("Relationship properties - connect", () => { union ActedInUnion = Movie | Show - interface ActedInInterface { + interface ActedInInterface @relationshipProperties { screenTime: Int! } `; @@ -232,7 +232,7 @@ describe("Relationship properties - connect", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; @@ -323,7 +323,7 @@ describe("Relationship properties - connect", () => { @relationship(type: "ACTED_IN", properties: "ActedInInterface", direction: OUT) } union ActedInUnion = Movie | Show - interface ActedInInterface { + interface ActedInInterface @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/create.int.test.ts b/packages/graphql/tests/integration/relationship-properties/create.int.test.ts index 887c026fb8..bdf378ea24 100644 --- a/packages/graphql/tests/integration/relationship-properties/create.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/create.int.test.ts @@ -135,7 +135,7 @@ describe("Relationship properties - create", () => { publications: [Publication!]! @relationship(type: "WROTE", properties: "Wrote", direction: OUT) } - interface Wrote { + interface Wrote @relationshipProperties { words: Int! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/delete.int.test.ts b/packages/graphql/tests/integration/relationship-properties/delete.int.test.ts index 951108374c..7a48cb8ad2 100644 --- a/packages/graphql/tests/integration/relationship-properties/delete.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/delete.int.test.ts @@ -134,7 +134,7 @@ describe("Relationship properties - delete", () => { union ActedInUnion = Movie | Show - interface ActedInInterface { + interface ActedInInterface @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/relationship-properties/disconnect.int.test.ts b/packages/graphql/tests/integration/relationship-properties/disconnect.int.test.ts index ee54fdd458..c0e70362a7 100644 --- a/packages/graphql/tests/integration/relationship-properties/disconnect.int.test.ts +++ b/packages/graphql/tests/integration/relationship-properties/disconnect.int.test.ts @@ -136,7 +136,7 @@ describe("Relationship properties - disconnect", () => { union ActedInUnion = Movie | Show - interface ActedInInterface { + interface ActedInInterface @relationshipProperties { screenTime: Int! } `; diff --git a/packages/graphql/tests/integration/subscriptions/create-relationship/create.int.test.ts b/packages/graphql/tests/integration/subscriptions/create-relationship/create.int.test.ts index b0d173b475..fd53738ce6 100644 --- a/packages/graphql/tests/integration/subscriptions/create-relationship/create.int.test.ts +++ b/packages/graphql/tests/integration/subscriptions/create-relationship/create.int.test.ts @@ -73,7 +73,7 @@ describe("Subscriptions connect with create", () => { year: Int! } - interface Review { + interface Review @relationshipProperties { score: Int! } diff --git a/packages/graphql/tests/integration/subscriptions/create-relationship/delete.int.test.ts b/packages/graphql/tests/integration/subscriptions/create-relationship/delete.int.test.ts index 6818b3a6d2..cdd99326c9 100644 --- a/packages/graphql/tests/integration/subscriptions/create-relationship/delete.int.test.ts +++ b/packages/graphql/tests/integration/subscriptions/create-relationship/delete.int.test.ts @@ -74,7 +74,7 @@ describe("Subscriptions connect with delete", () => { year: Int! } - interface Review { + interface Review @relationshipProperties { score: Int! } diff --git a/packages/graphql/tests/integration/subscriptions/create/connect-or-create.int.test.ts b/packages/graphql/tests/integration/subscriptions/create/connect-or-create.int.test.ts index b7b829d9aa..e2a195965f 100644 --- a/packages/graphql/tests/integration/subscriptions/create/connect-or-create.int.test.ts +++ b/packages/graphql/tests/integration/subscriptions/create/connect-or-create.int.test.ts @@ -56,7 +56,7 @@ describe("Create -> ConnectOrCreate", () => { ${typeMovie.plural}: [${typeMovie.name}!]! @relationship(type: "ACTED_IN", direction: OUT, properties:"ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int } `; From 35bf82f6296804278df2c632fa73fd2c45b4e0d8 Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 11:52:41 +0000 Subject: [PATCH 06/12] Updated more tests --- .../src/schema/make-augmented-schema.test.ts | 14 +++++++------- .../subscriptions/auth/authentication.int.test.ts | 2 +- .../subscriptions/create-relationship.e2e.test.ts | 2 +- .../e2e/subscriptions/delete-complex.e2e.test.ts | 2 +- ...nship-via-delete-with-relationships.e2e.test.ts | 2 +- .../delete-relationship-via-delete.e2e.test.ts | 2 +- .../subscriptions/delete-relationship.e2e.test.ts | 2 +- .../filtering/create-relationship.e2e.test.ts | 2 +- packages/graphql/tests/schema/aggregations.test.ts | 2 +- .../graphql/tests/schema/connect-or-create.test.ts | 2 +- .../graphql/tests/schema/connections/enums.test.ts | 2 +- .../tests/schema/connections/unions.test.ts | 2 +- .../rfc-autogenerated-properties-rel.test.ts | 10 +++++----- .../graphql/tests/schema/directives/alias.test.ts | 2 +- .../tests/schema/directives/populatedBy.test.ts | 10 +++++----- packages/graphql/tests/schema/issues/1614.test.ts | 2 +- .../tests/schema/string-comparators.test.ts | 2 +- packages/ogm/src/generate.test.ts | 2 +- 18 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/graphql/src/schema/make-augmented-schema.test.ts b/packages/graphql/src/schema/make-augmented-schema.test.ts index b98d4f6591..669580a1d2 100644 --- a/packages/graphql/src/schema/make-augmented-schema.test.ts +++ b/packages/graphql/src/schema/make-augmented-schema.test.ts @@ -208,7 +208,7 @@ describe("makeAugmentedSchema", () => { name: String } - interface ActedIn @auth(rules: [{ operations: [CREATE], roles: ["admin"] }]) { + interface ActedIn @auth(rules: [{ operations: [CREATE], roles: ["admin"] }]) @relationshipProperties { screenTime: Int } `; @@ -228,7 +228,7 @@ describe("makeAugmentedSchema", () => { name: String } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int @auth(rules: [{ operations: [CREATE], roles: ["admin"] }]) } `; @@ -246,7 +246,7 @@ describe("makeAugmentedSchema", () => { name: String } - interface ActedIn { + interface ActedIn @relationshipProperties { actors: Actor! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") } `; @@ -266,7 +266,7 @@ describe("makeAugmentedSchema", () => { name: String } - interface ActedIn { + interface ActedIn @relationshipProperties { id: ID @cypher(statement: "RETURN id(this) as id", columnName: "id") roles: [String] } @@ -285,7 +285,7 @@ describe("makeAugmentedSchema", () => { actors: [Actor!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { node: ID } @@ -306,7 +306,7 @@ describe("makeAugmentedSchema", () => { actors: [Actor!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { cursor: ID } @@ -334,7 +334,7 @@ describe("makeAugmentedSchema", () => { name: String } - interface ActedIn { + interface ActedIn @relationshipProperties { id: ID @unique roles: [String] } diff --git a/packages/graphql/tests/e2e/subscriptions/auth/authentication.int.test.ts b/packages/graphql/tests/e2e/subscriptions/auth/authentication.int.test.ts index 44387144ce..ea0b16d7a2 100644 --- a/packages/graphql/tests/e2e/subscriptions/auth/authentication.int.test.ts +++ b/packages/graphql/tests/e2e/subscriptions/auth/authentication.int.test.ts @@ -294,7 +294,7 @@ describe("Subscription authentication", () => { year: Int! } - interface Review { + interface Review @relationshipProperties { score: Int! } diff --git a/packages/graphql/tests/e2e/subscriptions/create-relationship.e2e.test.ts b/packages/graphql/tests/e2e/subscriptions/create-relationship.e2e.test.ts index 683c80f12d..9906e6b3c0 100644 --- a/packages/graphql/tests/e2e/subscriptions/create-relationship.e2e.test.ts +++ b/packages/graphql/tests/e2e/subscriptions/create-relationship.e2e.test.ts @@ -70,7 +70,7 @@ describe("Create Relationship Subscription", () => { year: Int! } - interface Review { + interface Review @relationshipProperties { score: Int! } diff --git a/packages/graphql/tests/e2e/subscriptions/delete-complex.e2e.test.ts b/packages/graphql/tests/e2e/subscriptions/delete-complex.e2e.test.ts index 53c2fd5f08..b996aef011 100644 --- a/packages/graphql/tests/e2e/subscriptions/delete-complex.e2e.test.ts +++ b/packages/graphql/tests/e2e/subscriptions/delete-complex.e2e.test.ts @@ -68,7 +68,7 @@ describe("Delete Subscriptions - with interfaces, unions and nested operations", year: Int! } - interface Review { + interface Review @relationshipProperties { score: Int! } diff --git a/packages/graphql/tests/e2e/subscriptions/delete-relationship-via-delete-with-relationships.e2e.test.ts b/packages/graphql/tests/e2e/subscriptions/delete-relationship-via-delete-with-relationships.e2e.test.ts index 79a631363c..cbc2d9e0c2 100644 --- a/packages/graphql/tests/e2e/subscriptions/delete-relationship-via-delete-with-relationships.e2e.test.ts +++ b/packages/graphql/tests/e2e/subscriptions/delete-relationship-via-delete-with-relationships.e2e.test.ts @@ -68,7 +68,7 @@ describe("Delete Subscriptions when relationships are targeted- with interfaces, year: Int! } - interface Review { + interface Review @relationshipProperties { score: Int! } diff --git a/packages/graphql/tests/e2e/subscriptions/delete-relationship-via-delete.e2e.test.ts b/packages/graphql/tests/e2e/subscriptions/delete-relationship-via-delete.e2e.test.ts index b02eecd33f..6dbc159018 100644 --- a/packages/graphql/tests/e2e/subscriptions/delete-relationship-via-delete.e2e.test.ts +++ b/packages/graphql/tests/e2e/subscriptions/delete-relationship-via-delete.e2e.test.ts @@ -68,7 +68,7 @@ describe("Delete Subscriptions when only nodes are targeted - with interfaces, u year: Int! } - interface Review { + interface Review @relationshipProperties { score: Int! } diff --git a/packages/graphql/tests/e2e/subscriptions/delete-relationship.e2e.test.ts b/packages/graphql/tests/e2e/subscriptions/delete-relationship.e2e.test.ts index 8d2b4fb719..be417ad8e9 100644 --- a/packages/graphql/tests/e2e/subscriptions/delete-relationship.e2e.test.ts +++ b/packages/graphql/tests/e2e/subscriptions/delete-relationship.e2e.test.ts @@ -71,7 +71,7 @@ describe("Delete Relationship Subscription", () => { year: Int! } - interface Review { + interface Review @relationshipProperties { score: Int! } diff --git a/packages/graphql/tests/e2e/subscriptions/filtering/create-relationship.e2e.test.ts b/packages/graphql/tests/e2e/subscriptions/filtering/create-relationship.e2e.test.ts index ab67421a9c..e03d40b3b4 100644 --- a/packages/graphql/tests/e2e/subscriptions/filtering/create-relationship.e2e.test.ts +++ b/packages/graphql/tests/e2e/subscriptions/filtering/create-relationship.e2e.test.ts @@ -70,7 +70,7 @@ describe("Connect Subscription with optional filters valid for all types", () => year: Int! } - interface Review { + interface Review @relationshipProperties { score: Int! } diff --git a/packages/graphql/tests/schema/aggregations.test.ts b/packages/graphql/tests/schema/aggregations.test.ts index b5c7cf9b1a..1039ba053e 100644 --- a/packages/graphql/tests/schema/aggregations.test.ts +++ b/packages/graphql/tests/schema/aggregations.test.ts @@ -412,7 +412,7 @@ describe("Aggregations", () => { likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") } - interface Likes { + interface Likes @relationshipProperties { someId: ID someString: String someFloat: Float diff --git a/packages/graphql/tests/schema/connect-or-create.test.ts b/packages/graphql/tests/schema/connect-or-create.test.ts index d4cf3a8bfd..3883ba6d25 100644 --- a/packages/graphql/tests/schema/connect-or-create.test.ts +++ b/packages/graphql/tests/schema/connect-or-create.test.ts @@ -512,7 +512,7 @@ describe("Connect Or Create", () => { movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screentime: Int! characterName: String } diff --git a/packages/graphql/tests/schema/connections/enums.test.ts b/packages/graphql/tests/schema/connections/enums.test.ts index 28177333dc..53864b8721 100644 --- a/packages/graphql/tests/schema/connections/enums.test.ts +++ b/packages/graphql/tests/schema/connections/enums.test.ts @@ -40,7 +40,7 @@ describe("Enums", () => { SUPPORTING } - interface ActedIn { + interface ActedIn @relationshipProperties { roleType: RoleType! } `; diff --git a/packages/graphql/tests/schema/connections/unions.test.ts b/packages/graphql/tests/schema/connections/unions.test.ts index 364402d781..33555b5a5e 100644 --- a/packages/graphql/tests/schema/connections/unions.test.ts +++ b/packages/graphql/tests/schema/connections/unions.test.ts @@ -42,7 +42,7 @@ describe("Unions", () => { author: [Author!]! @relationship(type: "WROTE", direction: IN, properties: "Wrote") } - interface Wrote { + interface Wrote @relationshipProperties { words: Int! } `; diff --git a/packages/graphql/tests/schema/deprecated/rfc-autogenerated-properties-rel.test.ts b/packages/graphql/tests/schema/deprecated/rfc-autogenerated-properties-rel.test.ts index 2f60148a49..9120b04f3b 100644 --- a/packages/graphql/tests/schema/deprecated/rfc-autogenerated-properties-rel.test.ts +++ b/packages/graphql/tests/schema/deprecated/rfc-autogenerated-properties-rel.test.ts @@ -31,7 +31,7 @@ describe("schema/rfc/autogenerate-properties-rel", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "RelProperties") } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback1: String! @callback(operations: [CREATE], name: "callback4") @default(value: "Test") } @@ -57,7 +57,7 @@ describe("schema/rfc/autogenerate-properties-rel", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "RelProperties") } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback1: String! @callback(operations: [CREATE], name: "callback4") @id } @@ -84,7 +84,7 @@ describe("schema/rfc/autogenerate-properties-rel", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "RelProperties") } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback1: String! @callback(operations: [CREATE], name: "callback4") } @@ -111,7 +111,7 @@ describe("schema/rfc/autogenerate-properties-rel", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "RelProperties") } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback1: String! @callback(operations: [CREATE], name: "callback1") callback2: String! @callback(operations: [UPDATE], name: "callback2") @@ -705,7 +705,7 @@ describe("schema/rfc/autogenerate-properties-rel", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "RelProperties") } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback1: Int! @callback(operations: [CREATE], name: "callback1") callback2: Int! @callback(operations: [UPDATE], name: "callback2") diff --git a/packages/graphql/tests/schema/directives/alias.test.ts b/packages/graphql/tests/schema/directives/alias.test.ts index 623102239c..7e01b3f275 100644 --- a/packages/graphql/tests/schema/directives/alias.test.ts +++ b/packages/graphql/tests/schema/directives/alias.test.ts @@ -36,7 +36,7 @@ describe("Alias", () => { rating: Float @alias(property: "ratingPropInDb") } - interface ActorActedInProps { + interface ActorActedInProps @relationshipProperties { character: String! @alias(property: "characterPropInDb") screenTime: Int } diff --git a/packages/graphql/tests/schema/directives/populatedBy.test.ts b/packages/graphql/tests/schema/directives/populatedBy.test.ts index 4f986c3454..913fa1049d 100644 --- a/packages/graphql/tests/schema/directives/populatedBy.test.ts +++ b/packages/graphql/tests/schema/directives/populatedBy.test.ts @@ -486,7 +486,7 @@ describe("@populatedBy tests", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "RelProperties") } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback1: String! @populatedBy(operations: [CREATE], callback: "callback4") @@ -514,7 +514,7 @@ describe("@populatedBy tests", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "RelProperties") } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback1: String! @populatedBy(operations: [CREATE], callback: "callback4") @id } @@ -541,7 +541,7 @@ describe("@populatedBy tests", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "RelProperties") } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback1: String! @populatedBy(operations: [CREATE], callback: "callback4") } @@ -570,7 +570,7 @@ describe("@populatedBy tests", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "RelProperties") } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback1: String! @populatedBy(operations: [CREATE], callback: "callback1") callback2: String! @populatedBy(operations: [UPDATE], callback: "callback2") @@ -1164,7 +1164,7 @@ describe("@populatedBy tests", () => { genres: [Genre!]! @relationship(type: "IN_GENRE", direction: OUT, properties: "RelProperties") } - interface RelProperties { + interface RelProperties @relationshipProperties { id: ID! callback1: Int! @populatedBy(operations: [CREATE], callback: "callback1") callback2: Int! @populatedBy(operations: [UPDATE], callback: "callback2") diff --git a/packages/graphql/tests/schema/issues/1614.test.ts b/packages/graphql/tests/schema/issues/1614.test.ts index ad9d0f662a..5574e31fd8 100644 --- a/packages/graphql/tests/schema/issues/1614.test.ts +++ b/packages/graphql/tests/schema/issues/1614.test.ts @@ -30,7 +30,7 @@ describe("https://github.com/neo4j/graphql/issues/1614", () => { KeyGrip } - interface CrewPosition { + interface CrewPosition @relationshipProperties { position: CrewPositionType } diff --git a/packages/graphql/tests/schema/string-comparators.test.ts b/packages/graphql/tests/schema/string-comparators.test.ts index bf968e0bc0..938aae2c91 100644 --- a/packages/graphql/tests/schema/string-comparators.test.ts +++ b/packages/graphql/tests/schema/string-comparators.test.ts @@ -478,7 +478,7 @@ describe("String Comparators", () => { actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: String } diff --git a/packages/ogm/src/generate.test.ts b/packages/ogm/src/generate.test.ts index 2f00d907b9..440f401000 100644 --- a/packages/ogm/src/generate.test.ts +++ b/packages/ogm/src/generate.test.ts @@ -893,7 +893,7 @@ describe("generate", () => { type Person { name: String! } - interface ActedIn { + interface ActedIn @relationshipProperties { screenTime: Int! } `; From 44bf3ccf8ec0bca3385d5eecbb101abcac272825 Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 12:21:41 +0000 Subject: [PATCH 07/12] Updated docs --- docs/modules/ROOT/pages/directives.adoc | 4 ++-- docs/modules/ROOT/pages/filtering.adoc | 2 +- docs/modules/ROOT/pages/queries.adoc | 2 +- .../ROOT/pages/subscriptions/events/create_relationship.adoc | 2 +- .../ROOT/pages/subscriptions/events/delete_relationship.adoc | 2 +- docs/modules/ROOT/pages/subscriptions/filtering.adoc | 2 +- .../graphql/src/graphql/directives/relationship-properties.ts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/modules/ROOT/pages/directives.adoc b/docs/modules/ROOT/pages/directives.adoc index 656803d75d..fd2d56e005 100644 --- a/docs/modules/ROOT/pages/directives.adoc +++ b/docs/modules/ROOT/pages/directives.adoc @@ -113,13 +113,13 @@ Reference: xref::type-definitions/relationships.adoc[Relationships] == `@relationshipProperties` -Optional syntactic sugar to help you distinguish between interfaces which are used for relationship properties, and otherwise. +Required to help you distinguish between interfaces which are used for relationship properties, and otherwise. Can only be used on interfaces, as per its definition: [source, graphql, indent=0] ---- -"""Syntactic sugar to help differentiate between interfaces for relationship properties, and otherwise.""" +"""Required to differentiate between interfaces for relationship properties, and otherwise.""" directive @relationshipProperties on INTERFACE ---- diff --git a/docs/modules/ROOT/pages/filtering.adoc b/docs/modules/ROOT/pages/filtering.adoc index 3c708436cc..0c7fd6644e 100644 --- a/docs/modules/ROOT/pages/filtering.adoc +++ b/docs/modules/ROOT/pages/filtering.adoc @@ -341,7 +341,7 @@ type Person { name: String } -interface ActedIn { +interface ActedIn @relationshipProperties { screenTime: Int } ---- diff --git a/docs/modules/ROOT/pages/queries.adoc b/docs/modules/ROOT/pages/queries.adoc index 5f57406ac6..3cc0757a00 100644 --- a/docs/modules/ROOT/pages/queries.adoc +++ b/docs/modules/ROOT/pages/queries.adoc @@ -24,7 +24,7 @@ type User { friends: [User!]! @relationship(type: "FRIENDS_WITH", direction: OUT) } -interface PostedAt { +interface PostedAt @relationshipProperties { date: DateTime } ---- diff --git a/docs/modules/ROOT/pages/subscriptions/events/create_relationship.adoc b/docs/modules/ROOT/pages/subscriptions/events/create_relationship.adoc index 4a31c0d5cb..9682bd27ae 100644 --- a/docs/modules/ROOT/pages/subscriptions/events/create_relationship.adoc +++ b/docs/modules/ROOT/pages/subscriptions/events/create_relationship.adoc @@ -226,7 +226,7 @@ type Influencer implements Reviewer { reputation: Int! } -interface Review { +interface Review @relationshipProperties { score: Int! } ``` diff --git a/docs/modules/ROOT/pages/subscriptions/events/delete_relationship.adoc b/docs/modules/ROOT/pages/subscriptions/events/delete_relationship.adoc index b28d67e53a..797e053bfa 100644 --- a/docs/modules/ROOT/pages/subscriptions/events/delete_relationship.adoc +++ b/docs/modules/ROOT/pages/subscriptions/events/delete_relationship.adoc @@ -226,7 +226,7 @@ type Influencer implements Reviewer { reputation: Int! } -interface Review { +interface Review @relationshipProperties { score: Int! } ``` diff --git a/docs/modules/ROOT/pages/subscriptions/filtering.adoc b/docs/modules/ROOT/pages/subscriptions/filtering.adoc index 1c85395101..a93bad6021 100644 --- a/docs/modules/ROOT/pages/subscriptions/filtering.adoc +++ b/docs/modules/ROOT/pages/subscriptions/filtering.adoc @@ -335,7 +335,7 @@ type Magazine implements Reviewer { reputation: Int! } -interface Review { +interface Review @relationshipProperties { score: Int! } ---- diff --git a/packages/graphql/src/graphql/directives/relationship-properties.ts b/packages/graphql/src/graphql/directives/relationship-properties.ts index 8dc00764ce..b23d470805 100644 --- a/packages/graphql/src/graphql/directives/relationship-properties.ts +++ b/packages/graphql/src/graphql/directives/relationship-properties.ts @@ -21,6 +21,6 @@ import { DirectiveLocation, GraphQLDirective } from "graphql"; export const relationshipPropertiesDirective = new GraphQLDirective({ name: "relationshipProperties", - description: "Syntactic sugar to help differentiate between interfaces for relationship properties, and otherwise.", + description: "Required to differentiate between interfaces for relationship properties, and otherwise.", locations: [DirectiveLocation.INTERFACE], }); From b5ea63e57a8d1ca5be3d41b663fd98b9b4e07e67 Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 13:01:57 +0000 Subject: [PATCH 08/12] More docs updates --- docs/modules/ROOT/pages/guides/v2-migration/mutations.adoc | 2 +- docs/modules/ROOT/pages/type-definitions/basics.adoc | 3 ++- docs/modules/ROOT/pages/type-definitions/interfaces.adoc | 2 +- docs/modules/ROOT/pages/type-definitions/relationships.adoc | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/modules/ROOT/pages/guides/v2-migration/mutations.adoc b/docs/modules/ROOT/pages/guides/v2-migration/mutations.adoc index fecbde2b93..ca289a52a2 100644 --- a/docs/modules/ROOT/pages/guides/v2-migration/mutations.adoc +++ b/docs/modules/ROOT/pages/guides/v2-migration/mutations.adoc @@ -1,7 +1,7 @@ [[v2-migration-mutations]] = Mutations -The most broadly affected area of functionality by the 2.0.0 upgrade are the nested operations of Mutations, to faciliate the mutation of and filtering on relationship properties. +The most broadly affected area of functionality by the 2.0.0 upgrade are the nested operations of Mutations, to facilitate the mutation of and filtering on relationship properties. The examples in this section will be based off the following type definitions: diff --git a/docs/modules/ROOT/pages/type-definitions/basics.adoc b/docs/modules/ROOT/pages/type-definitions/basics.adoc index 0f8e005eb4..3a93f50f21 100644 --- a/docs/modules/ROOT/pages/type-definitions/basics.adoc +++ b/docs/modules/ROOT/pages/type-definitions/basics.adoc @@ -39,7 +39,8 @@ Note there is a directive on each "end" of the relationship in this case, but it === Relationship properties -In order to add relationship properties to a relationship, you need to add a new type to your type definitions, but this time it will be of type `interface`. For example, for your "ACTED_IN" relationship, add a property "roles": +In order to add relationship properties to a relationship, you need to add a new type to your type definitions, but this time it will be of type `interface`. This interface must be decorated with the `@relationshipProperties` directive. +For example, for your "ACTED_IN" relationship, add a property "roles": [source, graphql, indent=0] ---- diff --git a/docs/modules/ROOT/pages/type-definitions/interfaces.adoc b/docs/modules/ROOT/pages/type-definitions/interfaces.adoc index 1671c1d4a0..9cf83c3639 100644 --- a/docs/modules/ROOT/pages/type-definitions/interfaces.adoc +++ b/docs/modules/ROOT/pages/type-definitions/interfaces.adoc @@ -5,7 +5,7 @@ The Neo4j GraphQL Library supports the use of interfaces on relationship fields. == Type definitions -The following schema defines a `Actor` type, that has a relationship `ACTED_IN`, of type `[Production!]!`. `Production` is an interface type with `Movie` and `Series` implementations. Note in this example that relationship properties have also been used with the `@relationshipProperties` directive as syntactic sugar, so that interfaces representing relationship properties can be easily distinguished. +The following schema defines a `Actor` type, that has a relationship `ACTED_IN`, of type `[Production!]!`. `Production` is an interface type with `Movie` and `Series` implementations. Note in this example that relationship properties have also been used with the `@relationshipProperties` directive, so that interfaces representing relationship properties can be easily distinguished. [source, graphql, indent=0] ---- diff --git a/docs/modules/ROOT/pages/type-definitions/relationships.adoc b/docs/modules/ROOT/pages/type-definitions/relationships.adoc index 6f9b6783de..bd34f9ecbb 100644 --- a/docs/modules/ROOT/pages/type-definitions/relationships.adoc +++ b/docs/modules/ROOT/pages/type-definitions/relationships.adoc @@ -56,7 +56,7 @@ The following should be noted about the fields you just added: Relationship properties can be added to the above type definitions in two steps: -1. Add an interface definition containing the desired relationship properties +1. Add an interface definition, decorated with the `@relationshipProperties` directive, containing the desired relationship properties 2. Add a `properties` argument to both "sides" of the `@relationship` directive which points to the newly defined interface For example, to distinguish which roles an actor played in a movie: From be6e50db60902e08edd31cd74443dd9c4419ff09 Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 13:14:46 +0000 Subject: [PATCH 09/12] Migration guide --- .../ROOT/pages/guides/v4-migration/index.adoc | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/docs/modules/ROOT/pages/guides/v4-migration/index.adoc b/docs/modules/ROOT/pages/guides/v4-migration/index.adoc index eb33c31d99..3da061a8b8 100644 --- a/docs/modules/ROOT/pages/guides/v4-migration/index.adoc +++ b/docs/modules/ROOT/pages/guides/v4-migration/index.adoc @@ -406,6 +406,48 @@ type query { Additionally, escaping strings is no longer needed. +=== Mandatory `@relationshipProperties` + +Upcoming changes to interfaces require us to distinguish between interfaces that are used to specify relationship properties, and others. Therefore, the `@relationshipProperties` directive is now required on all relationship property interfaces. +If it is not included, an error will be thrown. + +As a result, in version 4.0.0, the following type definitions are invalid: + +[source, graphql, indent=0] +---- +type Person { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} + +type Movie { + title: String! + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") +} + +interface ActedIn { + screenTime: Int! +} +---- + +Instead, they would need to be updated as below: + +[source, graphql, indent=0] +---- +type Person { + name: String! + movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn") +} + +type Movie { + title: String! + actors: [Person!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn") +} + +interface ActedIn @relationshipProperties { + screenTime: Int! +} +---- == Miscellaneous changes From 98a13a64515cd2d35ad68caa2273d329bf0d4b8c Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 13:42:35 +0000 Subject: [PATCH 10/12] Migration guide fix --- .../ROOT/pages/guides/v4-migration/index.adoc | 140 +++++++++--------- 1 file changed, 69 insertions(+), 71 deletions(-) diff --git a/docs/modules/ROOT/pages/guides/v4-migration/index.adoc b/docs/modules/ROOT/pages/guides/v4-migration/index.adoc index b9291dd0c1..b882d6bdb9 100644 --- a/docs/modules/ROOT/pages/guides/v4-migration/index.adoc +++ b/docs/modules/ROOT/pages/guides/v4-migration/index.adoc @@ -130,6 +130,75 @@ const neoSchema = new Neo4jGraphQL({ }) ---- +==== `requires` changes + +In version 4.0.0, it is now possible to require non-scalar fields. This means it is also possible to require fields on related type. +To make this possible, the `requires` argument now accept a graphql selection set instead of a list of strings. + +Therefore, the following type definitions: + +[source, graphql, indent=0] +---- +type User { + firstName: String! + lastName: String! + fullName: String! @customResolver(requires: ["firstName", "lastName"]) +} +---- + +Would need to be modified to use a selection set as below: + +[source, graphql, indent=0] +---- +type User { + firstName: String! + lastName: String! + fullName: String! @customResolver(requires: "firstName lastName") +} +---- + +Below is a more advanced example showing what the selection set is capable of: + +[source, graphql, indent=0] +---- +interface Publication { + publicationYear: Int! +} + +type Author { + name: String! + publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) + publicationsWithAuthor: [String!]! + @customResolver( + requires: "name publications { publicationYear ...on Book { title } ... on Journal { subject } }" + ) +} + +type Book implements Publication { + title: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} + +type Journal implements Publication { + subject: String! + publicationYear: Int! + author: [Author!]! @relationship(type: "WROTE", direction: IN) +} +---- + +Additionally, the requires argument also validates the required selection set against your type definitions. +Therefore, as there is no field called `someFieldThatDoesNotExist`, an error would be thrown on startup if you tried to use the following type definitions: + +[source, graphql, indent=0] +---- +type User { + firstName: String! + lastName: String! + fullName: String! @customResolver(requires: "firstName someFieldThatDoesNotExist") +} +---- + [plural-migration] === `plural` argument removed from `@node` and replaced with `@plural` @@ -406,77 +475,6 @@ type query { Additionally, escaping strings is no longer needed. -=== `@customResolver` changes - -In version 4.0.0, it is now possible to require non-scalar fields. This means it is also possible to require fields on related type. -To make this possible, the `requires` argument now accept a graphql selection set instead of a list of strings. - -Therefore, the following type definitions: - -[source, graphql, indent=0] ----- -type User { - firstName: String! - lastName: String! - fullName: String! @customResolver(requires: ["firstName", "lastName"]) -} ----- - -Would need to be modified to use a selection set as below: - -[source, graphql, indent=0] ----- -type User { - firstName: String! - lastName: String! - fullName: String! @customResolver(requires: "firstName lastName") -} ----- - -Below is a more advanced example showing what the selection set is capable of: - -[source, graphql, indent=0] ----- -interface Publication { - publicationYear: Int! -} - -type Author { - name: String! - publications: [Publication!]! @relationship(type: "WROTE", direction: OUT) - publicationsWithAuthor: [String!]! - @customResolver( - requires: "name publications { publicationYear ...on Book { title } ... on Journal { subject } }" - ) -} - -type Book implements Publication { - title: String! - publicationYear: Int! - author: [Author!]! @relationship(type: "WROTE", direction: IN) -} - -type Journal implements Publication { - subject: String! - publicationYear: Int! - author: [Author!]! @relationship(type: "WROTE", direction: IN) -} ----- - -Additionally, the requires argument also validates the required selection set against your type definitions. -Therefore, as there is no field called `someFieldThatDoesNotExist`, an error would be thrown on startup if you tried to use the following type definitions: - -[source, graphql, indent=0] ----- -type User { - firstName: String! - lastName: String! - fullName: String! @customResolver(requires: "firstName someFieldThatDoesNotExist") -} ----- - - - === Mandatory `@relationshipProperties` Upcoming changes to interfaces require us to distinguish between interfaces that are used to specify relationship properties, and others. Therefore, the `@relationshipProperties` directive is now required on all relationship property interfaces. From 8f0656b35b86a1d4966dea8cdb2a8ee5a3505dd6 Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 13:45:30 +0000 Subject: [PATCH 11/12] Changeset --- .changeset/quick-insects-turn.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/quick-insects-turn.md diff --git a/.changeset/quick-insects-turn.md b/.changeset/quick-insects-turn.md new file mode 100644 index 0000000000..1a7c27d446 --- /dev/null +++ b/.changeset/quick-insects-turn.md @@ -0,0 +1,5 @@ +--- +"@neo4j/graphql": major +--- + +Made `@relationshipProperties` mandatory for relationship property interfaces From a9ace0134e70aeb9fc48213312c98d8091049bae Mon Sep 17 00:00:00 2001 From: Liam Doodson Date: Tue, 28 Feb 2023 15:22:28 +0000 Subject: [PATCH 12/12] Updated tck tests --- .../tck/directives/customResolver.test.ts | 156 +++++++++--------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/packages/graphql/tests/tck/directives/customResolver.test.ts b/packages/graphql/tests/tck/directives/customResolver.test.ts index 0d88e51895..67dc8e244e 100644 --- a/packages/graphql/tests/tck/directives/customResolver.test.ts +++ b/packages/graphql/tests/tck/directives/customResolver.test.ts @@ -273,17 +273,17 @@ describe("@customResolver directive", () => { "MATCH (this:\`User\`) CALL { WITH this - MATCH (this)-[this0:LIVES_AT]->(this_address:\`Address\`) + MATCH (this)-[this0:LIVES_AT]->(this1:\`Address\`) CALL { - WITH this_address - MATCH (this_address)-[this1:IN_CITY]->(this_address_city:\`City\`) - WITH this_address_city { .name, .population } AS this_address_city - RETURN head(collect(this_address_city)) AS this_address_city + WITH this1 + MATCH (this1)-[this2:IN_CITY]->(this3:\`City\`) + WITH this3 { .name, .population } AS this3 + RETURN head(collect(this3)) AS var4 } - WITH this_address { city: this_address_city } AS this_address - RETURN head(collect(this_address)) AS this_address + WITH this1 { city: var4 } AS this1 + RETURN head(collect(this1)) AS var5 } - RETURN this { .firstName, .lastName, .fullName, address: this_address } AS this" + RETURN this { .firstName, .lastName, .fullName, address: var5 } AS this" `); expect(formatParams(result.params)).toMatchInlineSnapshot(`"{}"`); @@ -335,17 +335,17 @@ describe("@customResolver directive", () => { "MATCH (this:\`User\`) CALL { WITH this - MATCH (this)-[this0:LIVES_AT]->(this_address:\`Address\`) + MATCH (this)-[this0:LIVES_AT]->(this1:\`Address\`) CALL { - WITH this_address - MATCH (this_address)-[this1:IN_CITY]->(this_address_city:\`City\`) - WITH this_address_city { .population, .name } AS this_address_city - RETURN head(collect(this_address_city)) AS this_address_city + WITH this1 + MATCH (this1)-[this2:IN_CITY]->(this3:\`City\`) + WITH this3 { .population, .name } AS this3 + RETURN head(collect(this3)) AS var4 } - WITH this_address { city: this_address_city } AS this_address - RETURN head(collect(this_address)) AS this_address + WITH this1 { city: var4 } AS this1 + RETURN head(collect(this1)) AS var5 } - RETURN this { .lastName, .fullName, address: this_address, .firstName } AS this" + RETURN this { .lastName, .fullName, address: var5, .firstName } AS this" `); expect(formatParams(result.params)).toMatchInlineSnapshot(`"{}"`); @@ -369,17 +369,17 @@ describe("@customResolver directive", () => { "MATCH (this:\`User\`) CALL { WITH this - MATCH (this)-[this0:LIVES_AT]->(this_address:\`Address\`) + MATCH (this)-[this0:LIVES_AT]->(this1:\`Address\`) CALL { - WITH this_address - MATCH (this_address)-[this1:IN_CITY]->(this_address_city:\`City\`) - WITH this_address_city { .name, .population } AS this_address_city - RETURN head(collect(this_address_city)) AS this_address_city + WITH this1 + MATCH (this1)-[this2:IN_CITY]->(this3:\`City\`) + WITH this3 { .name, .population } AS this3 + RETURN head(collect(this3)) AS var4 } - WITH this_address { city: this_address_city } AS this_address - RETURN head(collect(this_address)) AS this_address + WITH this1 { city: var4 } AS this1 + RETURN head(collect(this1)) AS var5 } - RETURN this { .fullName, .firstName, .lastName, address: this_address } AS this" + RETURN this { .fullName, .firstName, .lastName, address: var5 } AS this" `); expect(formatParams(result.params)).toMatchInlineSnapshot(`"{}"`); @@ -453,19 +453,19 @@ describe("@customResolver directive", () => { WITH this CALL { WITH * - MATCH (this)-[this0:WROTE]->(this_publications:\`Book\`) - WITH this_publications { __resolveType: \\"Book\\", __id: id(this), .title } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this0:WROTE]->(this1:\`Book\`) + WITH this1 { __resolveType: \\"Book\\", __id: id(this), .title } AS this1 + RETURN this1 AS var2 UNION WITH * - MATCH (this)-[this1:WROTE]->(this_publications:\`Journal\`) - WITH this_publications { __resolveType: \\"Journal\\", __id: id(this), .subject } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this3:WROTE]->(this4:\`Journal\`) + WITH this4 { __resolveType: \\"Journal\\", __id: id(this), .subject } AS this4 + RETURN this4 AS var2 } - WITH this_publications - RETURN collect(this_publications) AS this_publications + WITH var2 + RETURN collect(var2) AS var2 } - RETURN this { .name, .publicationsWithAuthor, publications: this_publications } AS this" + RETURN this { .name, .publicationsWithAuthor, publications: var2 } AS this" `); expect(formatParams(result.params)).toMatchInlineSnapshot(`"{}"`); @@ -518,19 +518,19 @@ describe("@customResolver directive", () => { WITH this CALL { WITH * - MATCH (this)-[this0:WROTE]->(this_publications:\`Book\`) - WITH this_publications { __resolveType: \\"Book\\", __id: id(this), .title } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this0:WROTE]->(this1:\`Book\`) + WITH this1 { __resolveType: \\"Book\\", __id: id(this), .title } AS this1 + RETURN this1 AS var2 UNION WITH * - MATCH (this)-[this1:WROTE]->(this_publications:\`Journal\`) - WITH this_publications { __resolveType: \\"Journal\\", __id: id(this), .subject } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this3:WROTE]->(this4:\`Journal\`) + WITH this4 { __resolveType: \\"Journal\\", __id: id(this), .subject } AS this4 + RETURN this4 AS var2 } - WITH this_publications - RETURN collect(this_publications) AS this_publications + WITH var2 + RETURN collect(var2) AS var2 } - RETURN this { .publicationsWithAuthor, publications: this_publications, .name } AS this" + RETURN this { .publicationsWithAuthor, publications: var2, .name } AS this" `); expect(formatParams(result.params)).toMatchInlineSnapshot(`"{}"`); @@ -556,19 +556,19 @@ describe("@customResolver directive", () => { WITH this CALL { WITH * - MATCH (this)-[this0:WROTE]->(this_publications:\`Book\`) - WITH this_publications { __resolveType: \\"Book\\", __id: id(this), .title } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this0:WROTE]->(this1:\`Book\`) + WITH this1 { __resolveType: \\"Book\\", __id: id(this), .title } AS this1 + RETURN this1 AS var2 UNION WITH * - MATCH (this)-[this1:WROTE]->(this_publications:\`Journal\`) - WITH this_publications { __resolveType: \\"Journal\\", __id: id(this), .subject } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this3:WROTE]->(this4:\`Journal\`) + WITH this4 { __resolveType: \\"Journal\\", __id: id(this), .subject } AS this4 + RETURN this4 AS var2 } - WITH this_publications - RETURN collect(this_publications) AS this_publications + WITH var2 + RETURN collect(var2) AS var2 } - RETURN this { .publicationsWithAuthor, .name, publications: this_publications } AS this" + RETURN this { .publicationsWithAuthor, .name, publications: var2 } AS this" `); expect(formatParams(result.params)).toMatchInlineSnapshot(`"{}"`); @@ -647,19 +647,19 @@ describe("@customResolver directive", () => { WITH this CALL { WITH * - MATCH (this)-[this0:WROTE]->(this_publications:\`Book\`) - WITH this_publications { __resolveType: \\"Book\\", __id: id(this), .title, .publicationYear } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this0:WROTE]->(this1:\`Book\`) + WITH this1 { __resolveType: \\"Book\\", __id: id(this), .title, .publicationYear } AS this1 + RETURN this1 AS var2 UNION WITH * - MATCH (this)-[this1:WROTE]->(this_publications:\`Journal\`) - WITH this_publications { __resolveType: \\"Journal\\", __id: id(this), .subject, .publicationYear } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this3:WROTE]->(this4:\`Journal\`) + WITH this4 { __resolveType: \\"Journal\\", __id: id(this), .subject, .publicationYear } AS this4 + RETURN this4 AS var2 } - WITH this_publications - RETURN collect(this_publications) AS this_publications + WITH var2 + RETURN collect(var2) AS var2 } - RETURN this { .name, .publicationsWithAuthor, publications: this_publications } AS this" + RETURN this { .name, .publicationsWithAuthor, publications: var2 } AS this" `); expect(formatParams(result.params)).toMatchInlineSnapshot(`"{}"`); @@ -712,19 +712,19 @@ describe("@customResolver directive", () => { WITH this CALL { WITH * - MATCH (this)-[this0:WROTE]->(this_publications:\`Book\`) - WITH this_publications { __resolveType: \\"Book\\", __id: id(this), .title, .publicationYear } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this0:WROTE]->(this1:\`Book\`) + WITH this1 { __resolveType: \\"Book\\", __id: id(this), .title, .publicationYear } AS this1 + RETURN this1 AS var2 UNION WITH * - MATCH (this)-[this1:WROTE]->(this_publications:\`Journal\`) - WITH this_publications { __resolveType: \\"Journal\\", __id: id(this), .subject, .publicationYear } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this3:WROTE]->(this4:\`Journal\`) + WITH this4 { __resolveType: \\"Journal\\", __id: id(this), .subject, .publicationYear } AS this4 + RETURN this4 AS var2 } - WITH this_publications - RETURN collect(this_publications) AS this_publications + WITH var2 + RETURN collect(var2) AS var2 } - RETURN this { .publicationsWithAuthor, publications: this_publications, .name } AS this" + RETURN this { .publicationsWithAuthor, publications: var2, .name } AS this" `); expect(formatParams(result.params)).toMatchInlineSnapshot(`"{}"`); @@ -750,19 +750,19 @@ describe("@customResolver directive", () => { WITH this CALL { WITH * - MATCH (this)-[this0:WROTE]->(this_publications:\`Book\`) - WITH this_publications { __resolveType: \\"Book\\", __id: id(this), .title, .publicationYear } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this0:WROTE]->(this1:\`Book\`) + WITH this1 { __resolveType: \\"Book\\", __id: id(this), .title, .publicationYear } AS this1 + RETURN this1 AS var2 UNION WITH * - MATCH (this)-[this1:WROTE]->(this_publications:\`Journal\`) - WITH this_publications { __resolveType: \\"Journal\\", __id: id(this), .subject, .publicationYear } AS this_publications - RETURN this_publications AS this_publications + MATCH (this)-[this3:WROTE]->(this4:\`Journal\`) + WITH this4 { __resolveType: \\"Journal\\", __id: id(this), .subject, .publicationYear } AS this4 + RETURN this4 AS var2 } - WITH this_publications - RETURN collect(this_publications) AS this_publications + WITH var2 + RETURN collect(var2) AS var2 } - RETURN this { .publicationsWithAuthor, .name, publications: this_publications } AS this" + RETURN this { .publicationsWithAuthor, .name, publications: var2 } AS this" `); expect(formatParams(result.params)).toMatchInlineSnapshot(`"{}"`);