diff --git a/.changeset/cyan-grapes-laugh.md b/.changeset/cyan-grapes-laugh.md deleted file mode 100644 index 41fd62574b..0000000000 --- a/.changeset/cyan-grapes-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@neo4j/graphql": major ---- - -Remove support for `connectOrCreate` operations diff --git a/.changeset/healthy-swans-shave.md b/.changeset/healthy-swans-shave.md deleted file mode 100644 index 1fc4dac9b1..0000000000 --- a/.changeset/healthy-swans-shave.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@neo4j/graphql": major ---- - -The deprecated `directed` argument has been removed, and `queryDirection` now only accepts two possible values - `DIRECTED` (default) and `UNDIRECTED`. - -Additionally, the `directedArgument` setting of `excludeDeprecatedFields` has been removed as these deprecated fields have been removed. diff --git a/.changeset/little-lemons-fail.md b/.changeset/little-lemons-fail.md deleted file mode 100644 index b6f00f7705..0000000000 --- a/.changeset/little-lemons-fail.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -"@neo4j/graphql": major ---- - -Single element relationships have been removed in favor of list relationships: - -Before - -```graphql -type Movie { - director: Person @relationship(type: "DIRECTED", direction: "IN") -} -``` - -After - -```graphql -type Movie { - director: [Person!]! @relationship(type: "DIRECTED", direction: "IN") -} -``` - -This requires updating filters, clients and auth rules to use the list filter operations. - -Single element relationships cannot be reliably enforced, leading to a data inconsistent with the schema. If the GraphQL model requires 1-1 relationships (such as in federations) these can now be achieved with the `@cypher` directive instead: - -```graphql -type Movie { - director: Person - @cypher( - statement: """ - MATCH(this)-[:ACTED_IN]->(p:Person) - RETURN p - """ - columnName: "p" - ) -} -``` diff --git a/.changeset/loud-phones-march.md b/.changeset/loud-phones-march.md deleted file mode 100644 index 7c45f04987..0000000000 --- a/.changeset/loud-phones-march.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -"@neo4j/graphql": major ---- - -There have been major changes to the way that full-text search operates. - -The directive now requires the specification of an index name, query name, and indexed fields. - -```graphql -input FulltextInput { - indexName: String! - queryName: String! - fields: [String]! -} - -""" -Informs @neo4j/graphql that there should be a fulltext index in the database, allows users to search by the index in the generated schema. -""" -directive @fulltext(indexes: [FulltextInput]!) on OBJECT -``` - -Here is an example of how this might be used: - -```graphql -type Movie @node @fulltext(indexName: "movieTitleIndex", queryName: "moviesByTitle", fields: ["title"]) { - title: String! -} -``` - -Full-text search was previously available in two different locations. - -The following form has now been completely removed: - -```graphql -# Removed -{ - movies(fulltext: { movieTitleIndex: { phrase: "The Matrix" } }) { - title - } -} -``` - -The following form as a root-level query has been changed: - -```graphql -# Old query -query { - moviesByTitle(phrase: "The Matrix") { - score - movies { - title - } - } -} - -# New query -query { - moviesByTitle(phrase: "The Matrix") { - edges { - score - node { - title - } - } - } -} -``` - -The new form is as a Relay connection, which allows for pagination using cursors and access to the `pageInfo` field. diff --git a/.changeset/perfect-zoos-push.md b/.changeset/perfect-zoos-push.md deleted file mode 100644 index a73f35134c..0000000000 --- a/.changeset/perfect-zoos-push.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@neo4j/graphql": major ---- - -Change the way how `@node` behaves, `@node` is now required, and GraphQL Object types without the directive `@node` will no longer considered as a Neo4j Nodes representation. -Queries and Mutations will be generated only for types with the `@node` directive. diff --git a/.changeset/red-cows-shop.md b/.changeset/red-cows-shop.md deleted file mode 100644 index da7aaee903..0000000000 --- a/.changeset/red-cows-shop.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -"@neo4j/graphql": major ---- - -Implicit filtering fields have been removed, please use the explicit versions: - -```graphql -# Old syntax -{ - movies(where: { title: "The Matrix" }) { - title - } -} - -# New syntax -{ - movies(where: { title_EQ: "The Matrix" }) { - title - } -} -``` - -The `implicitEqualFilters` option of `excludeDeprecatedFields` has been removed. diff --git a/.changeset/short-pillows-itch.md b/.changeset/short-pillows-itch.md deleted file mode 100644 index d33cdecc13..0000000000 --- a/.changeset/short-pillows-itch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@neo4j/graphql": major ---- - -Remove support for `@unique` directive diff --git a/.changeset/slow-dolls-whisper.md b/.changeset/slow-dolls-whisper.md deleted file mode 100644 index 8e2b01f7b5..0000000000 --- a/.changeset/slow-dolls-whisper.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@neo4j/graphql": major ---- - -Remove `overwrite` field in connect operations diff --git a/.changeset/soft-planets-exercise.md b/.changeset/soft-planets-exercise.md deleted file mode 100644 index e7e22dfb8e..0000000000 --- a/.changeset/soft-planets-exercise.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -"@neo4j/graphql": major ---- - -The deprecated `options` argument has been removed. - -Consider the following type definitions: - -```graphql -type Movie { - title: String! -} -``` - -The migration is as below: - -```graphql -# Old syntax -{ - movies(options: { first: 10, offset: 10, sort: [{ title: ASC }] }) { - title - } -} - -# New syntax -{ - movies(first: 10, offset: 10, sort: [{ title: ASC }]) { - title - } -} -``` - -The `deprecatedOptionsArgument` of `excludeDeprecatedFields` has been removed as it is now a no-op. diff --git a/.changeset/strong-jobs-eat.md b/.changeset/strong-jobs-eat.md deleted file mode 100644 index e79e7eed08..0000000000 --- a/.changeset/strong-jobs-eat.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -"@neo4j/graphql": major ---- - -Implicit set operations have been removed. For example: - -```graphql -# Old syntax -mutation { - updateMovies(where: { title_EQ: "Matrix" }, update: { title: "The Matrix" }) { - movies { - title - } - } -} - -# New syntax -mutation { - updateMovies(where: { title_EQ: "Matrix" }, update: { title_SET: "The Matrix" }) { - movies { - title - } - } -} -``` - -The `implicitSet` argument of `excludeDeprecatedFields` has been removed. diff --git a/.changeset/ten-starfishes-attend.md b/.changeset/ten-starfishes-attend.md deleted file mode 100644 index 660d78aab8..0000000000 --- a/.changeset/ten-starfishes-attend.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@neo4j/introspector": major -"@neo4j/graphql": major ---- - -The Neo4j GraphQL Library and Introspector now required Node.js 22 or greater. diff --git a/packages/apollo-federation-subgraph-compatibility/package.json b/packages/apollo-federation-subgraph-compatibility/package.json index de3e868bc3..d1630e5d44 100644 --- a/packages/apollo-federation-subgraph-compatibility/package.json +++ b/packages/apollo-federation-subgraph-compatibility/package.json @@ -10,7 +10,7 @@ "dependencies": { "@apollo/server": "^4.7.0", "@graphql-tools/wrap": "^10.0.0", - "@neo4j/graphql": "^6.1.0", + "@neo4j/graphql": "^7.0.0", "graphql": "16.9.0", "graphql-tag": "^2.12.6", "neo4j-driver": "^5.8.0" diff --git a/packages/graphql/CHANGELOG.md b/packages/graphql/CHANGELOG.md index bc58c462bf..56e3d72521 100644 --- a/packages/graphql/CHANGELOG.md +++ b/packages/graphql/CHANGELOG.md @@ -1,5 +1,199 @@ # @neo4j/graphql +## 7.0.0 + +### Major Changes + +- [#5755](https://github.com/neo4j/graphql/pull/5755) [`9c75f92`](https://github.com/neo4j/graphql/commit/9c75f925884de42f64e1b5c3086cc87c114727bd) Thanks [@angrykoala](https://github.com/angrykoala)! - Remove support for `connectOrCreate` operations + +- [#5778](https://github.com/neo4j/graphql/pull/5778) [`56022ba`](https://github.com/neo4j/graphql/commit/56022ba38d8beb6cb5d7bbfb5e856fd57d9660c5) Thanks [@darrellwarde](https://github.com/darrellwarde)! - The deprecated `directed` argument has been removed, and `queryDirection` now only accepts two possible values - `DIRECTED` (default) and `UNDIRECTED`. + + Additionally, the `directedArgument` setting of `excludeDeprecatedFields` has been removed as these deprecated fields have been removed. + +- [#5819](https://github.com/neo4j/graphql/pull/5819) [`ac1fa62`](https://github.com/neo4j/graphql/commit/ac1fa629f1eb8b248116bd9dedaabc02117fdbee) Thanks [@angrykoala](https://github.com/angrykoala)! - Single element relationships have been removed in favor of list relationships: + + Before + + ```graphql + type Movie { + director: Person @relationship(type: "DIRECTED", direction: "IN") + } + ``` + + After + + ```graphql + type Movie { + director: [Person!]! @relationship(type: "DIRECTED", direction: "IN") + } + ``` + + This requires updating filters, clients and auth rules to use the list filter operations. + + Single element relationships cannot be reliably enforced, leading to a data inconsistent with the schema. If the GraphQL model requires 1-1 relationships (such as in federations) these can now be achieved with the `@cypher` directive instead: + + ```graphql + type Movie { + director: Person + @cypher( + statement: """ + MATCH(this)-[:ACTED_IN]->(p:Person) + RETURN p + """ + columnName: "p" + ) + } + ``` + +- [#5762](https://github.com/neo4j/graphql/pull/5762) [`87e416b`](https://github.com/neo4j/graphql/commit/87e416b2547b75824d9782fd5da90c003437e7c0) Thanks [@darrellwarde](https://github.com/darrellwarde)! - There have been major changes to the way that full-text search operates. + + The directive now requires the specification of an index name, query name, and indexed fields. + + ```graphql + input FulltextInput { + indexName: String! + queryName: String! + fields: [String]! + } + + """ + Informs @neo4j/graphql that there should be a fulltext index in the database, allows users to search by the index in the generated schema. + """ + directive @fulltext(indexes: [FulltextInput]!) on OBJECT + ``` + + Here is an example of how this might be used: + + ```graphql + type Movie @node @fulltext(indexName: "movieTitleIndex", queryName: "moviesByTitle", fields: ["title"]) { + title: String! + } + ``` + + Full-text search was previously available in two different locations. + + The following form has now been completely removed: + + ```graphql + # Removed + { + movies(fulltext: { movieTitleIndex: { phrase: "The Matrix" } }) { + title + } + } + ``` + + The following form as a root-level query has been changed: + + ```graphql + # Old query + query { + moviesByTitle(phrase: "The Matrix") { + score + movies { + title + } + } + } + + # New query + query { + moviesByTitle(phrase: "The Matrix") { + edges { + score + node { + title + } + } + } + } + ``` + + The new form is as a Relay connection, which allows for pagination using cursors and access to the `pageInfo` field. + +- [#5820](https://github.com/neo4j/graphql/pull/5820) [`d8d59f8`](https://github.com/neo4j/graphql/commit/d8d59f80480017d27b49b062321a9a15b6494a96) Thanks [@MacondoExpress](https://github.com/MacondoExpress)! - Change the way how `@node` behaves, `@node` is now required, and GraphQL Object types without the directive `@node` will no longer considered as a Neo4j Nodes representation. + Queries and Mutations will be generated only for types with the `@node` directive. + +- [#5801](https://github.com/neo4j/graphql/pull/5801) [`95ce8bb`](https://github.com/neo4j/graphql/commit/95ce8bb884bddaf20d751f2448b5504a7b94d081) Thanks [@darrellwarde](https://github.com/darrellwarde)! - Implicit filtering fields have been removed, please use the explicit versions: + + ```graphql + # Old syntax + { + movies(where: { title: "The Matrix" }) { + title + } + } + + # New syntax + { + movies(where: { title_EQ: "The Matrix" }) { + title + } + } + ``` + + The `implicitEqualFilters` option of `excludeDeprecatedFields` has been removed. + +- [#5755](https://github.com/neo4j/graphql/pull/5755) [`9c75f92`](https://github.com/neo4j/graphql/commit/9c75f925884de42f64e1b5c3086cc87c114727bd) Thanks [@angrykoala](https://github.com/angrykoala)! - Remove support for `@unique` directive + +- [#5768](https://github.com/neo4j/graphql/pull/5768) [`e338590`](https://github.com/neo4j/graphql/commit/e338590d25216cced8252cfe3d0789d97952c20d) Thanks [@angrykoala](https://github.com/angrykoala)! - Remove `overwrite` field in connect operations + +- [#5777](https://github.com/neo4j/graphql/pull/5777) [`0ecfd71`](https://github.com/neo4j/graphql/commit/0ecfd71a1431c5f98fde30319eefd5b018a06701) Thanks [@darrellwarde](https://github.com/darrellwarde)! - The deprecated `options` argument has been removed. + + Consider the following type definitions: + + ```graphql + type Movie { + title: String! + } + ``` + + The migration is as below: + + ```graphql + # Old syntax + { + movies(options: { first: 10, offset: 10, sort: [{ title: ASC }] }) { + title + } + } + + # New syntax + { + movies(first: 10, offset: 10, sort: [{ title: ASC }]) { + title + } + } + ``` + + The `deprecatedOptionsArgument` of `excludeDeprecatedFields` has been removed as it is now a no-op. + +- [#5802](https://github.com/neo4j/graphql/pull/5802) [`99cb9aa`](https://github.com/neo4j/graphql/commit/99cb9aa866eed04224d790bfccab9c3d3add78b7) Thanks [@darrellwarde](https://github.com/darrellwarde)! - Implicit set operations have been removed. For example: + + ```graphql + # Old syntax + mutation { + updateMovies(where: { title_EQ: "Matrix" }, update: { title: "The Matrix" }) { + movies { + title + } + } + } + + # New syntax + mutation { + updateMovies(where: { title_EQ: "Matrix" }, update: { title_SET: "The Matrix" }) { + movies { + title + } + } + } + ``` + + The `implicitSet` argument of `excludeDeprecatedFields` has been removed. + +- [#5789](https://github.com/neo4j/graphql/pull/5789) [`1a07d40`](https://github.com/neo4j/graphql/commit/1a07d40888e89c5cd9a40edc16f1742e27bff687) Thanks [@darrellwarde](https://github.com/darrellwarde)! - The Neo4j GraphQL Library and Introspector now required Node.js 22 or greater. + ## 6.1.0 ### Minor Changes diff --git a/packages/graphql/package.json b/packages/graphql/package.json index e092344de2..0c938bd0b6 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -1,6 +1,6 @@ { "name": "@neo4j/graphql", - "version": "6.1.0", + "version": "7.0.0", "description": "A GraphQL to Cypher query execution layer for Neo4j and JavaScript GraphQL implementations", "keywords": [ "neo4j", diff --git a/packages/introspector/CHANGELOG.md b/packages/introspector/CHANGELOG.md index c3956e6632..f75594a51e 100644 --- a/packages/introspector/CHANGELOG.md +++ b/packages/introspector/CHANGELOG.md @@ -1,5 +1,11 @@ # @neo4j/introspector +## 5.0.0 + +### Major Changes + +- [#5789](https://github.com/neo4j/graphql/pull/5789) [`1a07d40`](https://github.com/neo4j/graphql/commit/1a07d40888e89c5cd9a40edc16f1742e27bff687) Thanks [@darrellwarde](https://github.com/darrellwarde)! - The Neo4j GraphQL Library and Introspector now required Node.js 22 or greater. + ## 4.0.0 ### Major Changes diff --git a/packages/introspector/package.json b/packages/introspector/package.json index 65000b106e..a2bd184bce 100644 --- a/packages/introspector/package.json +++ b/packages/introspector/package.json @@ -1,6 +1,6 @@ { "name": "@neo4j/introspector", - "version": "4.0.0", + "version": "5.0.0", "description": "Introspect a Neo4j database model/schema", "keywords": [ "neo4j", @@ -34,7 +34,7 @@ }, "author": "Neo4j Inc.", "devDependencies": { - "@neo4j/graphql": "^6.0.0", + "@neo4j/graphql": "^7.0.0", "@types/jest": "29.5.14", "@types/node": "22.9.0", "@types/pluralize": "0.0.33", diff --git a/yarn.lock b/yarn.lock index 5254ba15b8..eedd52833f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2072,7 +2072,7 @@ __metadata: languageName: node linkType: soft -"@neo4j/graphql@npm:^6.0.0, @neo4j/graphql@npm:^6.1.0, @neo4j/graphql@workspace:packages/graphql": +"@neo4j/graphql@npm:^7.0.0, @neo4j/graphql@workspace:packages/graphql": version: 0.0.0-use.local resolution: "@neo4j/graphql@workspace:packages/graphql" dependencies: @@ -2133,7 +2133,7 @@ __metadata: version: 0.0.0-use.local resolution: "@neo4j/introspector@workspace:packages/introspector" dependencies: - "@neo4j/graphql": "npm:^6.0.0" + "@neo4j/graphql": "npm:^7.0.0" "@types/jest": "npm:29.5.14" "@types/node": "npm:22.9.0" "@types/pluralize": "npm:0.0.33" @@ -3787,7 +3787,7 @@ __metadata: "@apollo/federation-subgraph-compatibility": "npm:2.2.0" "@apollo/server": "npm:^4.7.0" "@graphql-tools/wrap": "npm:^10.0.0" - "@neo4j/graphql": "npm:^6.1.0" + "@neo4j/graphql": "npm:^7.0.0" fork-ts-checker-webpack-plugin: "npm:9.0.2" graphql: "npm:16.9.0" graphql-tag: "npm:^2.12.6"