From 9c75f925884de42f64e1b5c3086cc87c114727bd Mon Sep 17 00:00:00 2001 From: angrykoala Date: Mon, 4 Nov 2024 14:10:19 +0000 Subject: [PATCH] Update changeset --- .changeset/cyan-grapes-laugh.md | 5 ++++ .changeset/short-pillows-itch.md | 5 ++++ .../annotation/UniqueAnnotation.ts | 29 ------------------- .../ConcreteEntityAdapter.test.ts | 3 +- .../RelationshipAdapter.test.ts | 5 ++-- 5 files changed, 13 insertions(+), 34 deletions(-) create mode 100644 .changeset/cyan-grapes-laugh.md create mode 100644 .changeset/short-pillows-itch.md delete mode 100644 packages/graphql/src/schema-model/annotation/UniqueAnnotation.ts diff --git a/.changeset/cyan-grapes-laugh.md b/.changeset/cyan-grapes-laugh.md new file mode 100644 index 0000000000..41fd62574b --- /dev/null +++ b/.changeset/cyan-grapes-laugh.md @@ -0,0 +1,5 @@ +--- +"@neo4j/graphql": major +--- + +Remove support for `connectOrCreate` operations diff --git a/.changeset/short-pillows-itch.md b/.changeset/short-pillows-itch.md new file mode 100644 index 0000000000..d33cdecc13 --- /dev/null +++ b/.changeset/short-pillows-itch.md @@ -0,0 +1,5 @@ +--- +"@neo4j/graphql": major +--- + +Remove support for `@unique` directive diff --git a/packages/graphql/src/schema-model/annotation/UniqueAnnotation.ts b/packages/graphql/src/schema-model/annotation/UniqueAnnotation.ts deleted file mode 100644 index 367f69ff21..0000000000 --- a/packages/graphql/src/schema-model/annotation/UniqueAnnotation.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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 { Annotation } from "./Annotation"; - -export class UniqueAnnotation implements Annotation { - readonly name = "unique"; - public readonly constraintName?: string; - - constructor({ constraintName }: { constraintName?: string }) { - this.constraintName = constraintName; - } -} diff --git a/packages/graphql/src/schema-model/entity/model-adapters/ConcreteEntityAdapter.test.ts b/packages/graphql/src/schema-model/entity/model-adapters/ConcreteEntityAdapter.test.ts index 042172b655..c9ba2cc9ae 100644 --- a/packages/graphql/src/schema-model/entity/model-adapters/ConcreteEntityAdapter.test.ts +++ b/packages/graphql/src/schema-model/entity/model-adapters/ConcreteEntityAdapter.test.ts @@ -18,7 +18,6 @@ */ import { CypherAnnotation } from "../../annotation/CypherAnnotation"; -import { UniqueAnnotation } from "../../annotation/UniqueAnnotation"; import { Attribute } from "../../attribute/Attribute"; import { GraphQLBuiltInScalarType, ScalarType } from "../../attribute/AttributeType"; import { AttributeAdapter } from "../../attribute/model-adapters/AttributeAdapter"; @@ -34,7 +33,7 @@ describe("ConcreteEntityAdapter", () => { beforeAll(() => { const idAttribute = new Attribute({ name: "id", - annotations: { unique: new UniqueAnnotation({ constraintName: "User_id_unique" }) }, + annotations: {}, type: new ScalarType(GraphQLBuiltInScalarType.ID, true), args: [], }); diff --git a/packages/graphql/src/schema-model/relationship/model-adapters/RelationshipAdapter.test.ts b/packages/graphql/src/schema-model/relationship/model-adapters/RelationshipAdapter.test.ts index ba352de775..db5f506743 100644 --- a/packages/graphql/src/schema-model/relationship/model-adapters/RelationshipAdapter.test.ts +++ b/packages/graphql/src/schema-model/relationship/model-adapters/RelationshipAdapter.test.ts @@ -18,7 +18,6 @@ */ import { SelectableAnnotation } from "../../annotation/SelectableAnnotation"; -import { UniqueAnnotation } from "../../annotation/UniqueAnnotation"; import { Attribute } from "../../attribute/Attribute"; import { GraphQLBuiltInScalarType, ScalarType } from "../../attribute/AttributeType"; import { ConcreteEntity } from "../../entity/ConcreteEntity"; @@ -33,7 +32,7 @@ describe("RelationshipAdapter", () => { beforeAll(() => { const userId = new Attribute({ name: "id", - annotations: { unique: new UniqueAnnotation({ constraintName: "User_id_unique" }) }, + annotations: {}, type: new ScalarType(GraphQLBuiltInScalarType.ID, true), args: [], }); @@ -47,7 +46,7 @@ describe("RelationshipAdapter", () => { const accountId = new Attribute({ name: "id", - annotations: { unique: new UniqueAnnotation({ constraintName: "User_id_unique" }) }, + annotations: {}, type: new ScalarType(GraphQLBuiltInScalarType.ID, true), args: [], });