Skip to content

Commit fe8c789

Browse files
angrykoalaMacondoExpress
authored andcommitted
WIP migration guide for version 7
1 parent 6dee67f commit fe8c789

File tree

1 file changed

+222
-3
lines changed

1 file changed

+222
-3
lines changed

modules/ROOT/pages/migration/index.adoc

Lines changed: 222 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The `@unique` directive is no longer supported:
2828
[source, graphql, indent=0]
2929
----
3030
type Movie {
31-
title: String! @unique()
31+
title: String! @unique
3232
}
3333
----
3434

@@ -56,7 +56,23 @@ type Movie {
5656
----
5757
|===
5858

59-
Single element relationships cannot be reliably enforced, leading to a data inconsistent with the schema.
59+
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:
60+
61+
62+
[source, graphql, indent=0]
63+
----
64+
type Movie {
65+
director: Person
66+
@cypher(
67+
statement: """
68+
MATCH(this)-[:ACTED_IN]->(p:Person)
69+
RETURN p
70+
"""
71+
columnName: "p"
72+
)
73+
}
74+
----
75+
6076

6177

6278
=== `overwrite`
@@ -68,8 +84,211 @@ This is part of the overarching changes to how `connect` operations work in 7.x.
6884
Instead, use the `update` operation to update a relationship.
6985

7086

71-
=== Removed the `connectOrCreate` operation
87+
=== Removed support for `connectOrCreate` operations
7288

7389
The `connectOrCreate` operation has been removed due to limitations on its feature set when compared to other operations.
7490

7591
`connectOrCreate` relies on `MERGE` operations in Cypher, which did not allow for `onCreate` operations to follow nested relationships.
92+
93+
94+
=== Remove `*aggregate` fields
95+
96+
* Remove `deprecatedAggregateOperations` from the `excludeDeprecatedFields`
97+
98+
=== Subscriptions are opt-in
99+
100+
101+
=== `Neo4jGraphQLSubscriptionsEngine` remove `publish` method
102+
103+
=== When performing a connect operation, new relationships are always created
104+
105+
=== Change results when 2 nodes have multiple relationships
106+
Changes the result projection where there are multiple relationships between two nodes.
107+
108+
In the case of using the connection API then multiple relationships will still be represented, as there is the ability to select the relationship properties. In the non-connection API case, the duplicate results will only return distinct results.
109+
110+
111+
=== The `typename_IN` filter has been rmeoved in favor of `typename`
112+
113+
=== Aggregations are no longer supported for ID fields.
114+
115+
116+
117+
=== Remove `@private`` directive. This directive was intended to be used with the library `@neo4j/graphql-ogm` which is no longer supported.
118+
119+
=== Fails schema generation if there are conflicting plural names in types.
120+
121+
For example, the following schema will fail, due to ambiguous `Techs` plural
122+
123+
```graphql
124+
type Tech @node(plural: "Techs") {
125+
name: String
126+
}
127+
128+
type Techs {
129+
value: String
130+
}
131+
```
132+
133+
134+
=== The deprecated directed argument has been removed, and queryDirection now only accepts two possible values - DIRECTED (default) and UNDIRECTED
135+
Additionally, the directedArgument setting of excludeDeprecatedFields has been removed as these deprecated fields have been removed.
136+
137+
138+
139+
140+
=== Full text
141+
There have been major changes to the way that full-text search operates.
142+
143+
The directive now requires the specification of an index name, query name, and indexed fields
144+
145+
```
146+
input FulltextInput {
147+
indexName: String!
148+
queryName: String!
149+
fields: [String]!
150+
}
151+
152+
"""
153+
Informs @neo4j/graphql that there should be a fulltext index in the database, allows users to search by the index in the generated schema.
154+
"""
155+
directive @fulltext(indexes: [FulltextInput]!) on OBJECT
156+
```
157+
158+
Here is an example of how this might be used:
159+
```
160+
type Movie @node @fulltext(indexName: "movieTitleIndex", queryName: "moviesByTitle", fields: ["title"]) {
161+
title: String!
162+
}
163+
```
164+
165+
Full-text search was previously available in two different locations.
166+
167+
The following form has now been completely removed:
168+
169+
```
170+
{
171+
movies(fulltext: { movieTitleIndex: { phrase: "The Matrix" } }) {
172+
title
173+
}
174+
}
175+
```
176+
177+
The following form as a root-level query has been changed:
178+
179+
```
180+
query {
181+
moviesByTitle(phrase: "The Matrix") {
182+
score
183+
movies {
184+
title
185+
}
186+
}
187+
}
188+
189+
query {
190+
moviesByTitle(phrase: "The Matrix") {
191+
edges {
192+
score
193+
node {
194+
title
195+
}
196+
}
197+
}
198+
}
199+
```
200+
201+
The new form is as a Relay connection, which allows for pagination using cursors and access to the pageInfo field.
202+
203+
=== `@node` behaviour
204+
205+
@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.
206+
207+
=== Implicit filtering fields have been removed, please use the explicit versions:
208+
209+
```graphql
210+
{
211+
movies(where: { title: "The Matrix" }) {
212+
title
213+
}
214+
}
215+
216+
{
217+
movies(where: { title: { eq: "The Matrix" } }) {
218+
title
219+
}
220+
}
221+
```
222+
223+
The `implicitEqualFilters` option of `excludeDeprecatedFields` has been removed.
224+
225+
226+
=== The deprecated `options`` argument has been removed.
227+
228+
Consider the following type definitions:
229+
230+
type Movie {
231+
title: String!
232+
}
233+
234+
The migration is as below:
235+
```
236+
# Old syntax
237+
{
238+
movies(options: { first: 10, offset: 10, sort: [{ title: ASC }] }) {
239+
title
240+
}
241+
}
242+
243+
# New syntax
244+
{
245+
movies(first: 10, offset: 10, sort: [{ title: ASC }]) {
246+
title
247+
}
248+
}
249+
```
250+
251+
The deprecatedOptionsArgument of excludeDeprecatedFields has been removed as it is now a no-op.
252+
253+
=== Implicit set operations have been removed.
254+
255+
For example:
256+
257+
```
258+
# Old syntax
259+
mutation {
260+
updateMovies(where: { title_EQ: "Matrix" }, update: { title: "The Matrix" }) {
261+
movies {
262+
title
263+
}
264+
}
265+
}
266+
267+
# New syntax
268+
mutation {
269+
updateMovies(where: { title_EQ: "Matrix" }, update: { title_SET: "The Matrix" }) {
270+
movies {
271+
title
272+
}
273+
}
274+
}
275+
```
276+
277+
The `implicitSet` argument of `excludeDeprecatedFields` has been removed.
278+
279+
280+
=== The Neo4j GraphQL Library and Introspector now required Node.js 22 or greater.
281+
282+
=== `@coalesce` applies to return
283+
284+
=== Set `addVersionPrefix` to true by default, this adds `CYPHER 5` to cypher queries
285+
286+
287+
=== DateTime and Time values are now converted from strings into temporal types in the generated Cypher instead of in server code using the driver.
288+
289+
This could result in different values when the database is in a different timezone to the GraphQL server.
290+
291+
292+
=== Nested mutation operations now follow the relationship direction behaviour as defined in queryDirection
293+
294+

0 commit comments

Comments
 (0)