Skip to content

Commit ecc2cb2

Browse files
committed
Merge remote-tracking branch 'origin/6.x' into update-subscriptions-docs
2 parents 76268a9 + fa20501 commit ecc2cb2

34 files changed

+213
-1517
lines changed

README.adoc

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
= Neo4j GraphQL Library
1+
= Neo4j GraphQL library docs
22

33
This repo contains the documentation for the Neo4j GraphQL Library.
44

5-
== Prereqs
5+
== Prerequisites
66

77
- link:https://nodejs.org/en/download/[Node.js]
88
- npm
@@ -113,3 +113,33 @@ When we publish preview content to either development or production environments
113113

114114
You can use the link:https://www.npmjs.com/package/@neo4j-antora/antora-add-notes[antora-add-notes] extension to add content to your pages.
115115
Follow the Usage instructions in the package documentation.
116+
117+
== Repository and pull requests
118+
119+
=== Enable automatic cherry-picking on a PR
120+
121+
To enable automatic cherry-picking on a PR, add the label `auto-cherry-pick` to it.
122+
Without it, the responsible GitHub action is not going to be triggered.
123+
124+
To select the target branches you would like to cherry-pick your PR to, add labels of the following structure: `auto-cherry-pick-to-<targetBranch>`.
125+
For example: `auto-cherry-pick-to-6.x` to cherry-pick it to the branch `6.x` or `auto-cherry-pick-to-5.x` for the branch `5.x`.
126+
You may even add new labels for branches that do not have such a label yet.
127+
128+
The feature is triggered by either merging a PR with the `auto-cherry-pick` label or by adding the `auto-cherry-pick` label to an already closed and merged PR.
129+
In the latter case, ensure that you first add the labels containing the target branches and then finally the `auto-cherry-pick` label.
130+
Otherwise the automation starts without any target branches.
131+
132+
==== Details
133+
134+
The PRs created by this GitHub action will have their heading prefixed with `[Cherry-pick][<targetBranch>]`.
135+
So, for example, for `6.x` as the target branch and `some changes` as the original PR heading, it results in `[Cherry-pick][6.x] some changes` as the heading for the cherry-picked PR.
136+
In case an assignee was set for the original PR, the cherry-picked PRs will also receive the same assignee.
137+
You must add reviewers manually after the cherry-picked PRs have been created.
138+
139+
The creation of cherry-picked PRs can take a few minutes.
140+
If you are an assignee of the original PR, you receive an email notification once the cherry-picked PRs have been created.
141+
The original PR is updated with a comment that contains links to the newly created cherry-picked PRs.
142+
143+
In case of a merge conflict while cherry-picking to a specific release branch, the branch will be skipped. Information on skipped branches is also included in the comment added to the original PR.
144+
In that case you will have to take care of cherry-picking manually and resolve the conflicts.
145+
This is not going to influence the other release branches as long as they do not have conflicts.

modules/ROOT/content-nav.adoc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@
6060
6161
* xref:introspector.adoc[Introspector]
6262
63-
* xref:ogm/index.adoc[]
64-
** xref:ogm/installation.adoc[]
65-
** xref:ogm/directives.adoc[]
66-
** xref:ogm/selection-set.adoc[]
67-
** xref:ogm/type-generation.adoc[]
68-
** xref:ogm/subscriptions.adoc[]
69-
** xref:ogm/reference.adoc[]
70-
7163
* *Frameworks and integrations*
7264
7365
* xref:integrations/apollo-federation.adoc[]

modules/ROOT/pages/directives/custom-logic.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= Custom logic
2-
:page-aliases: type-definitions/cypher.adoc, type-definitions/default-values.adoc, ogm/examples/custom-resolvers.adoc, custom-resolvers.adoc
2+
:page-aliases: type-definitions/cypher.adoc, type-definitions/default-values.adoc, custom-resolvers.adoc
33
:description: This page describes how to use directives for custom logic.
44

55
== `@cypher`

modules/ROOT/pages/directives/index.adoc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,6 @@ of any required fields that is passed as arguments to the custom resolver.
140140

141141
|===
142142

143-
== OGM
144-
145-
[cols="2,5"]
146-
|===
147-
| Directive | Description
148-
149-
| xref::ogm/directives.adoc#_private[`@private`]
150-
| Protects fields which should only be available through the xref::ogm/index.adoc[OGM].
151-
152-
|===
153-
154143
== Relay
155144

156145
[cols="2,5"]

modules/ROOT/pages/directives/indexes-and-constraints.adoc

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ directive @unique(
1818
) on FIELD_DEFINITION
1919
----
2020

21-
Using this directive does not automatically ensure the existence of these constraints, and you will need to run a function on server startup.
22-
See the section xref::/directives/indexes-and-constraints.adoc#_asserting_constraints[Asserting constraints] for details.
21+
Using this directive does not automatically ensure the existence of these constraints, and you will need to create them manually.
2322

2423
=== Usage
2524

26-
`@unique` directives can only be used in GraphQL object types representing nodes, and they are only applicable for the "main" label for the node.
25+
`@unique` directives can only be used in GraphQL object types representing nodes, for any label specified on them.
2726

2827
In the following example, a unique constraint is asserted for the label `Colour` and the property `hexadecimal`:
2928

@@ -53,7 +52,7 @@ type Colour @node(labels: ["Color"]) {
5352
----
5453

5554
In the following example, all labels specified in the `labels` argument of the `@node` directive are also checked when asserting constraints.
56-
If there is a unique constraint specified for the `hexadecimal` property of nodes with the `Hue` label, but not the `Color` label, no error is thrown and no new constraints are created when running `assertIndexesAndConstraints`.
55+
If there is a unique constraint specified for the `hexadecimal` property of nodes with the `Hue` label, but not the `Color` label, no error is thrown when running `assertIndexesAndConstraints`.
5756

5857
[source, graphql, indent=0]
5958
----
@@ -64,7 +63,7 @@ type Colour @node(labels: ["Color", "Hue"]) {
6463

6564
== Fulltext indexes
6665

67-
You can use the `@fulltext` directive to add a https://neo4j.com/docs/cypher-manual/current/indexes-for-full-text-search/[Full text index] inside Neo4j.
66+
You can use the `@fulltext` directive to specify a https://neo4j.com/docs/cypher-manual/current/indexes-for-full-text-search/[full-text index] inside Neo4j.
6867
For example:
6968

7069
[source, graphql, indent=0]
@@ -82,13 +81,12 @@ directive @fulltext(indexes: [FullTextInput]!) on OBJECT
8281
----
8382

8483
Using this directive does not automatically ensure the existence of these indexes.
85-
You need to run a function on server startup.
86-
See the section xref::/directives/indexes-and-constraints.adoc#_asserting_constraints[Asserting constraints] for details.
84+
They must be created manually.
8785

8886
=== Specifying
8987

9088
The `@fulltext` directive can be used on nodes.
91-
In this example, a `Fulltext` index called "ProductName", for the name `field`, on the `Product` node, is added:
89+
In this example, a full-text index called "ProductName", for the name `field`, on the `Product` node, is specified:
9290

9391
[source, graphql, indent=0]
9492
----
@@ -98,7 +96,7 @@ type Product @fulltext(indexes: [{ indexName: "ProductName", fields: ["name"] }]
9896
}
9997
----
10098

101-
When you run xref::/directives/indexes-and-constraints.adoc#_asserting_constraints[Asserting constraints], they create the index like so:
99+
This index can be created in the database by running the following Cypher:
102100

103101
[source, cypher, indent=0]
104102
----
@@ -224,8 +222,8 @@ query {
224222
== Asserting constraints
225223

226224
In order to ensure that the specified constraints exist in the database, you need to run the function `assertIndexesAndConstraints`.
227-
A simple example to create the necessary constraints might look like the following, assuming a valid driver instance in the variable `driver`.
228-
This creates two constraints, one for each field decorated with `@id` and `@unique`, and apply the indexes specified in `@fulltext`:
225+
A simple example to check for the existence of the necessary constraints might look like the following, assuming a valid driver instance in the variable `driver`.
226+
This checks for the unique node property constraint for the field decorated `@unique`, and checks for the index specified in `@fulltext`:
229227

230228
[source, javascript, indent=0]
231229
----
@@ -245,10 +243,9 @@ const neoSchema = new Neo4jGraphQL({ typeDefs, driver });
245243
246244
const schema = await neoSchema.getSchema();
247245
248-
await neoSchema.assertIndexesAndConstraints({ options: { create: true }});
246+
await neoSchema.assertIndexesAndConstraints();
249247
----
250248

251-
252249
:description: Directives related to generative AI in the Neo4j GraphQL Library.
253250

254251
[role=label--beta]

modules/ROOT/pages/driver-configuration.adoc

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This page describes the configuration of the Neo4j GraphQL Library driver.
66

77
== Neo4j Driver
88

9-
For the Neo4j GraphQL Library to work, either an instance of the https://github.com/neo4j/neo4j-javascript-driver[Neo4j JavaScript driver] must be passed in on construction of your `Neo4jGraphQL` instance (or alternatively, `OGM`), or a driver, session or transaction passed into the `context.executionContext` per request.
9+
For the Neo4j GraphQL Library to work, either an instance of the https://github.com/neo4j/neo4j-javascript-driver[Neo4j JavaScript driver] must be passed in on construction of your `Neo4jGraphQL` instance, or a driver, session or transaction passed into the `context.executionContext` per request.
1010

1111
The examples in this page assume a Neo4j database running at "bolt://localhost:7687" with a username of "username" and a password of "password".
1212

@@ -143,31 +143,10 @@ await startStandaloneServer(server, {
143143
144144
----
145145

146-
=== OGM
147-
148-
[source, javascript, indent=0]
149-
----
150-
import { OGM } from "@neo4j/graphql-ogm";
151-
import neo4j from "neo4j-driver";
152-
153-
const typeDefs = `#graphql
154-
type User @node {
155-
name: String
156-
}
157-
`;
158-
159-
const driver = neo4j.driver(
160-
"bolt://localhost:7687",
161-
neo4j.auth.basic("username", "password")
162-
);
163-
164-
const ogm = new OGM({ typeDefs, driver });
165-
----
166-
167146
[[driver-configuration-database-compatibility]]
168147
== Database compatibility
169148

170-
Use the `checkNeo4jCompat` method available on either a `Neo4jGraphQL` or `OGM` instance to ensure the specified DBMS is of the required version, and has the necessary functions and procedures available.
149+
Use the `checkNeo4jCompat` method available on a `Neo4jGraphQL` instance to ensure the specified DBMS is of the required version, and has the necessary functions and procedures available.
171150
The `checkNeo4jCompat` throws an `Error` if the DBMS is incompatible, with details of the incompatibilities.
172151

173152
=== `Neo4jGraphQL`
@@ -192,28 +171,6 @@ const neoSchema = new Neo4jGraphQL({ typeDefs, driver });
192171
await neoSchema.checkNeo4jCompat();
193172
----
194173

195-
=== `OGM`
196-
197-
[source, javascript, indent=0]
198-
----
199-
import { OGM } from "@neo4j/graphql-ogm";
200-
import neo4j from "neo4j-driver";
201-
202-
const typeDefs = `#graphql
203-
type User @node {
204-
name: String
205-
}
206-
`;
207-
208-
const driver = neo4j.driver(
209-
"bolt://localhost:7687",
210-
neo4j.auth.basic("username", "password")
211-
);
212-
213-
const ogm = new OGM({ typeDefs, driver });
214-
await ogm.checkNeo4jCompat();
215-
----
216-
217174
== Specifying the Neo4j database
218175

219176
Specify the database to be used within your DBMS via the `database` field under `sessionConfig` in the `context` that all resolvers share.

modules/ROOT/pages/index.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ For every query and mutation that is executed against this generated schema, the
3131
- Options for xref::/directives/database-mapping.adoc[Database mapping] and value xref::/directives/autogeneration.adoc[Autogeneration].
3232
- xref::/queries-aggregations/pagination/index.adoc[Pagination] options.
3333
- xref::/security/index.adoc[Security options] and additional xref::schema-configuration/index.adoc[Schema Configuration].
34-
- An xref::ogm/index.adoc[OGM] (Object Graph Mapper) for programmatic interaction with your GraphQL API.
3534
- A xref::getting-started/toolbox.adoc[Toolbox] (UI) to experiment with your Neo4j GraphQL API on Neo4j Desktop.
3635

3736

@@ -69,9 +68,9 @@ Additionally, prerelease version numbers may have additional suffixes, for examp
6968

7069
== Requirements
7170

72-
. https://neo4j.com/[Neo4j Database] version 4.4 or newer with https://neo4j.com/docs/apoc/current/[APOC] plugin.
71+
. https://neo4j.com/[Neo4j Database] version 5.x with https://neo4j.com/docs/apoc/current/[APOC] plugin.
7372
. Neo4j version 5.15 or newer when you are using the xref:/directives/indexes-and-constraints.adoc#_vector_index_search[`@vector` directive].
74-
. https://nodejs.org/en/[Node.js] 16+.
73+
. https://nodejs.org/en/[Node.js] 20+.
7574

7675
== Resources
7776

modules/ROOT/pages/migration/index.adoc

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,119 @@ npm update @neo4j/graphql
2020

2121
Here is a list of all the breaking changes from version 5.0.0 to 6.0.0.
2222

23+
=== The deprecated `_NOT` filters are no longer supported
24+
25+
The following deprecated `NOT` filters are removed from the schema since they are no longer supported:
26+
27+
- `_NOT`
28+
- `_NOT_CONTAINS`
29+
- `_NOT_ENDS_WITH`
30+
- `_NOT_IN`
31+
- `_NOT_STARTS_WITH`
32+
- `_NOT_INCUDES`
33+
- `node_NOT`
34+
- `edge_NOT`
35+
36+
37+
To achieve the same in version 6.x of the GraphQL library, use the xref:/queries-aggregations/filtering.adoc#_boolean_operators[boolean `NOT` operator] instead.
38+
39+
[cols="1,1"]
40+
|===
41+
|Before | Now
42+
43+
a|
44+
[source, graphql, indent=0]
45+
----
46+
query {
47+
movies(where: { title_NOT: "The Matrix" }) {
48+
title
49+
}
50+
}
51+
52+
----
53+
a|
54+
[source, graphql, indent=0]
55+
----
56+
query {
57+
movies(where: { NOT: { title_EQ: "The Matrix" } }) {
58+
title
59+
}
60+
}
61+
----
62+
|===
63+
64+
=== The deprecated `_NOT` on `@relationship` filters are no longer supported
65+
66+
The following deprecated `_NOT` filters on `@relationship` are removed and no longer supported:
67+
68+
- `actors_NOT`
69+
- `actorsConnection_NOT`
70+
71+
To achieve the same in version 6.x of the GraphQL library, use the `NONE` quantifier.
72+
73+
[cols="1,1"]
74+
|===
75+
|Before | Now
76+
77+
a|
78+
[source, graphql, indent=0]
79+
----
80+
query {
81+
movies(where: { actors_NOT: { name_EQ: "Keanu" } }) {
82+
title
83+
}
84+
}
85+
----
86+
a|
87+
[source, graphql, indent=0]
88+
----
89+
query {
90+
movies(where: { actors_NONE: { name_EQ: "Keanu" } }) {
91+
title
92+
}
93+
}
94+
----
95+
|===
2396

2497
== Deprecations and warnings
2598

99+
=== Implicit equality filters are deprecated
100+
101+
The following implicit equality filters are deprecated:
102+
103+
- `{ name: "Keanu" }`
104+
- `{ count: 10 }`
105+
106+
You can achieve the same by using `{ name_EQ: "Keanu" }` and `{ count_EQ: 10 }`.
107+
The deprecated quality filters will be removed in version 7.x.
108+
109+
[cols="1,1"]
110+
|===
111+
|Before | Now
112+
113+
a|
114+
[source, graphql, indent=0]
115+
----
116+
query {
117+
users(where: { name: "John" }) {
118+
id
119+
name
120+
}
121+
}
122+
----
123+
a|
124+
[source, graphql, indent=0]
125+
----
126+
query {
127+
users(where: { name_EQ: "John" }) {
128+
id
129+
name
130+
}
131+
}
132+
----
133+
|===
134+
135+
26136
=== `@node` will have to be explicitly defined
27137

28138
In the future, types without the `@node` directive will no longer be treated as Neo4j nodes.

modules/ROOT/pages/mutations/create.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ mutation {
140140
name: "Tom Hanks",
141141
movies: {
142142
connectOrCreate: {
143-
where: { node: { id: "1234" } }
143+
where: { node: { id_EQ: "1234" } }
144144
onCreate: { node: { title: "Forrest Gump" } }
145145
}
146146
}

0 commit comments

Comments
 (0)