Skip to content

Commit

Permalink
Merge pull request #5758 from neo4j/deprecate-override
Browse files Browse the repository at this point in the history
Deprecate overwrite argument
  • Loading branch information
angrykoala authored Nov 8, 2024
2 parents ae00eaf + 7521476 commit e1fc2cf
Show file tree
Hide file tree
Showing 54 changed files with 739 additions and 725 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-dryers-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@neo4j/graphql": patch
---

Argument `overwrite` in `connect` operations has been deprecated
7 changes: 7 additions & 0 deletions packages/graphql/src/schema/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ export const DEPRECATE_CONNECT_OR_CREATE = {
reason: "The connectOrCreate operation is deprecated and will be removed",
},
};

export const DEPRECATE_OVERWRITE = {
name: DEPRECATED,
args: {
reason: "The overwrite argument is deprecated and will be removed",
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@

import { GraphQLBoolean, GraphQLNonNull } from "graphql";
import type { InputTypeComposerFieldConfigDefinition } from "graphql-compose";
import { DEPRECATE_OVERWRITE } from "../../constants";

export const overwrite: InputTypeComposerFieldConfigDefinition = {
type: new GraphQLNonNull(GraphQLBoolean),
description: "Whether or not to overwrite any matching relationship with the new properties.",
defaultValue: true,
directives: [DEPRECATE_OVERWRITE],
};
2 changes: 1 addition & 1 deletion packages/graphql/tests/schema/aggregations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ describe("Aggregations", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: UserConnectWhere
}
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/tests/schema/array-methods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe("Arrays Methods", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: MovieConnectWhere
}
Expand Down Expand Up @@ -387,7 +387,7 @@ describe("Arrays Methods", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: ActorConnectWhere
}
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/tests/schema/authorization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe("Authorization", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: UserConnectWhere
}
Expand Down Expand Up @@ -401,7 +401,7 @@ describe("Authorization", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: UserConnectWhere
}
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/tests/schema/comments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ describe("Comments", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: ActorConnectWhere
}
Expand Down
6 changes: 3 additions & 3 deletions packages/graphql/tests/schema/connect-or-create-id.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe("connect or create with id", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: MovieConnectWhere
}
Expand Down Expand Up @@ -566,7 +566,7 @@ describe("connect or create with id", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: UserConnectWhere
}
Expand Down Expand Up @@ -887,7 +887,7 @@ describe("connect or create with id", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: PostConnectWhere
}
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/tests/schema/connect-or-create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe("Connect Or Create", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: MovieConnectWhere
}
Expand Down Expand Up @@ -609,7 +609,7 @@ describe("Connect Or Create", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: MovieConnectWhere
}
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/tests/schema/connections/enums.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe("Enums", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: MovieConnectWhere
}
Expand Down Expand Up @@ -358,7 +358,7 @@ describe("Enums", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: ActorConnectWhere
}
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/tests/schema/connections/sort.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe("Sort", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: Node2ConnectWhere
}
Expand Down Expand Up @@ -322,7 +322,7 @@ describe("Sort", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: Node1ConnectWhere
}
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/tests/schema/connections/unions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ describe("Unions", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: AuthorConnectWhere
}
Expand Down Expand Up @@ -605,7 +605,7 @@ describe("Unions", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: AuthorConnectWhere
}
Expand Down
20 changes: 10 additions & 10 deletions packages/graphql/tests/schema/directive-preserve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ describe("Directive-preserve", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: MovieConnectWhere
}
Expand Down Expand Up @@ -557,7 +557,7 @@ describe("Directive-preserve", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: GenreConnectWhere
}
Expand Down Expand Up @@ -1184,7 +1184,7 @@ describe("Directive-preserve", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: ActorConnectWhere
}
Expand Down Expand Up @@ -1375,7 +1375,7 @@ describe("Directive-preserve", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: ActorConnectWhere
}
Expand Down Expand Up @@ -1659,7 +1659,7 @@ describe("Directive-preserve", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: ActorConnectWhere
}
Expand Down Expand Up @@ -2241,7 +2241,7 @@ describe("Directive-preserve", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: ActorConnectWhere
}
Expand Down Expand Up @@ -2566,7 +2566,7 @@ describe("Directive-preserve", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: ActorConnectWhere
}
Expand Down Expand Up @@ -3171,7 +3171,7 @@ describe("Directive-preserve", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: ActorConnectWhere
}
Expand Down Expand Up @@ -3496,7 +3496,7 @@ describe("Directive-preserve", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: ActorConnectWhere
}
Expand Down Expand Up @@ -3819,7 +3819,7 @@ describe("Directive-preserve", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: PostConnectWhere
}
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/tests/schema/directives/alias.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe("Alias", () => {
\\"\\"\\"
Whether or not to overwrite any matching relationship with the new properties.
\\"\\"\\"
overwrite: Boolean! = true
overwrite: Boolean! = true @deprecated(reason: \\"The overwrite argument is deprecated and will be removed\\")
where: MovieConnectWhere
}
Expand Down
Loading

0 comments on commit e1fc2cf

Please sign in to comment.