Skip to content

Commit 625ac8f

Browse files
Merge branch 'migration-guide-7' into apply-v7-changes-on-documentation
2 parents 00552ce + f27cc97 commit 625ac8f

File tree

1 file changed

+87
-40
lines changed

1 file changed

+87
-40
lines changed

modules/ROOT/pages/migration/index.adoc

Lines changed: 87 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,10 @@ For example, an actor playing multiple roles in the same movie.
328328

329329
=== Changed behavior for multiple relationships between nodes
330330

331-
The way multiple relationships between the same two nodes are handled has changed:
331+
The way multiple relationships are handled between the same two nodes has changed:
332332

333-
* In entity query fields (like `movies`), duplicate nodes will be removed and only distinct results will be returned, regardless of how many relationships exist between the nodes.
334-
335-
* In connection query fields (like `moviesConnection`), all relationships will be represented individually. This allows for projecting relationship properties for each connection between the two nodes.
333+
* In entity query fields (like `movies`), duplicate nodes are removed and only distinct results are returned, regardless of how many relationships exist between the nodes.
334+
* In connection query fields (like `moviesConnection`), all relationships are represented individually. This allows for projecting relationship properties for each connection between the two nodes.
336335

337336
For example, consider a scenario where Eddie Murphy played multiple roles in the same movie:
338337

@@ -358,7 +357,7 @@ With a standard entity query:
358357
}
359358
----
360359

361-
The result will show "The Nutty Professor" only once (nodes are deduplicated):
360+
The result shows "The Nutty Professor" only once (nodes are deduplicated):
362361

363362
[source, json, indent=0]
364363
----
@@ -430,12 +429,13 @@ The result preserves both relationships with their distinct properties:
430429
}
431430
----
432431

433-
=== The `@private` directive has been removed.
432+
=== Removed the `@private` directive
434433

435434
This directive was intended to be used with the library `@neo4j/graphql-ogm` which is no longer supported.
436435

437-
=== Schema generation fails if there are conflicting plural names in types
436+
=== Schema generation avoids conflicting plural names
438437

438+
Schema generation now detects conflicting plural names in types and fails intentionally.
439439
For example, the following schema will fail due to ambiguous `Techs` plural:
440440

441441
[source, graphql, indent=0]
@@ -487,8 +487,7 @@ type Movie @node @fulltext(
487487
----
488488

489489
Full-text search was previously available in two different locations.
490-
491-
The following form has now been completely removed:
490+
The following form has been completely removed:
492491

493492
[source, graphql, indent=0]
494493
----
@@ -500,7 +499,7 @@ The following form has now been completely removed:
500499
}
501500
----
502501

503-
The root-level query has been changed to use the Relay Cursor Connections Specification:
502+
The root-level query has been changed to use the https://relay.dev/graphql/connections.htm[Relay Cursor Connections Specification]:
504503

505504
[cols="1,1"]
506505
|===
@@ -538,15 +537,15 @@ query {
538537
----
539538
|===
540539

541-
The new form uses the Relay Cursor Connections Specification, which allows for pagination using cursors and access to the `pageInfo` field.
540+
The new form uses the https://relay.dev/graphql/connections.htm[Relay Cursor Connections Specification], which allows for pagination using cursors and access to the `pageInfo` field.
542541

543542
=== Removed implicit set operations
544543

545544
Implicit set operations in update mutations have been removed and the migration path involves two steps:
546545

547546
[cols="1,1"]
548547
|===
549-
| Before (Removed) | After (Desired Syntax)
548+
| Before | After
550549

551550
a|
552551
[source, graphql, indent=0]
@@ -583,9 +582,9 @@ The `implicitSet` option of `excludeDeprecatedFields` has been removed.
583582

584583
=== `@coalesce` directive affects projection field values
585584

586-
In version 7.0.0, the `@coalesce` directive now applies to both filter operations and field projections. Previously, the fallback values specified in the `@coalesce` directive were only used when those fields were used in filters, but not on the returned fields.
587-
588-
Now, when you select a field annotated with `@coalesce`, null values will be replaced with the specified fallback value in the query result.
585+
In version 7.0.0, the `@coalesce` directive now applies to both filter operations and field projections.
586+
Previously, the fallback values specified in the `@coalesce` directive were only used when those fields were used in filters, but not on the returned fields.
587+
Now, when you select a field annotated with `@coalesce`, null values are replaced with the specified fallback value in the query result.
589588

590589
Consider this schema:
591590

@@ -621,7 +620,7 @@ query {
621620
}
622621
----
623622

624-
Now, the same query will return the coalesced value:
623+
Now, the same query returns the coalesced value:
625624

626625
[source, json, indent=0]
627626
----
@@ -639,7 +638,8 @@ This ensures consistent behavior between filtering and projecting fields with th
639638

640639
=== Set `addVersionPrefix` to true by default
641640

642-
In version 7.0.0, the `addVersionPrefix` option is now set to `true` by default. This means that all generated Cypher queries will automatically be prefixed with the Cypher version:
641+
In version 7.0.0, the `addVersionPrefix` option is set to `true` by default.
642+
This means that all generated Cypher queries are automatically prefixed with the Cypher version:
643643

644644
[source, cypher, indent=0]
645645
----
@@ -648,9 +648,10 @@ CYPHER 5
648648
MATCH(this:Movie)
649649
----
650650

651-
This ensures that the correct Cypher version is used when queries are executed in Neo4j. However, this change may be incompatible with older versions of Neo4j.
651+
This ensures that the correct Cypher version is used when queries are executed in Neo4j.
652+
However, this change may be incompatible with older versions of Neo4j.
652653

653-
If you need to disable this behavior, you can set `cypherQueryOptions.addVersionPrefix` to `false` in the context:
654+
Set `cypherQueryOptions.addVersionPrefix` to `false` to disable this behavior:
654655

655656
[source, javascript, indent=0]
656657
----
@@ -677,11 +678,11 @@ await startStandaloneServer(server, {
677678
----
678679

679680

680-
=== Changed DateTime and Time value conversion behavior
681+
=== Changed `DateTime` and `Time` value conversion behavior
681682

682-
In version 7.0.0, `DateTime` and `Time` values are now converted from strings into temporal types directly in the generated Cypher queries, rather than in server code using the Neo4j driver.
683+
In version 7.0.0, `DateTime` and `Time` values are converted from Strings to temporal types directly in the generated Cypher queries, rather than in server code using the Neo4j driver.
683684

684-
For example, if you have a date string in your GraphQL query:
685+
For example, if you have a date String in your GraphQL query:
685686

686687
[source, graphql, indent=0]
687688
----
@@ -702,14 +703,16 @@ WHERE this.releaseDate > datetime($param0)
702703
RETURN this { .title, .releaseDate } as this
703704
----
704705

705-
=== Mutation operations now follow the relationship direction defined in the `@relationship` argument queryDirection
706+
=== Mutation operations follow relationship directions
706707

707-
Mutation operations now respect the `queryDirection` value defined in the `@relationship` directive when matching existing relationships. This ensures consistent behavior between queries and mutations regarding how relationships are traversed.
708+
Mutation operations now respect the `queryDirection` value defined in the `@relationship` directive when matching existing relationships.
709+
This ensures consistent behavior between queries and mutations regarding how relationships are traversed.
708710

709-
Important to note:
710-
711-
- When creating new relationships, the physical direction stored in the database is still determined by the `direction` argument.
712-
- The change affects only how existing relationships are matched during mutation operations.
711+
[NOTE]
712+
====
713+
When creating new relationships, the physical direction stored in the database is still determined by the `direction` argument.
714+
The change affects only how existing relationships are matched during mutation operations.
715+
====
713716

714717
For example, consider the following schema:
715718

@@ -726,13 +729,13 @@ type Person @node {
726729
}
727730
----
728731

729-
With `queryDirection: UNDIRECTED`, mutations will now traverse existing relationships in both directions when matching nodes, regardless of the base `direction` value. This is consistent with how queries work with the same directive configuration.
730-
732+
With `queryDirection: UNDIRECTED`, mutations now traverse existing relationships in both directions when matching nodes, regardless of the base `direction` value.
733+
This is consistent with how queries work with the same directive configuration.
731734
Previously, mutations would always follow the explicit `direction` value when matching existing relationships, which could lead to inconsistent behavior between queries and mutations.
732735

733736
=== Moved `where` field in nested update operations
734737

735-
The `where` field for nested update operations has been removed, in favour of the `where` inside the nested update input.
738+
The `where` field for nested update operations has been removed in favor of the `where` inside the nested update input.
736739

737740
[cols="1,1"]
738741
|===
@@ -802,7 +805,8 @@ type Actor @node {
802805
}
803806
----
804807

805-
Previously, when using `single` or `some` filters with unions, conditions inside these filters were evaluated separately for each concrete type in the union, requiring all of them to match. This was incorrect behavior.
808+
Previously, when using `single` or `some` filters with unions, conditions inside these filters were evaluated separately for each concrete type in the union, requiring all of them to match.
809+
This behavior was incorrect.
806810

807811
[source, graphql, indent=0]
808812
----
@@ -823,15 +827,54 @@ The fixed behavior in version 7.0.0:
823827
* `some`: Now correctly returns actors with at least one matching related node of any type in the union.
824828

825829
This change provides more logical and consistent results, but may affect existing queries that relied on the previous behavior.
826-
827830
This fix applies to both the new filter syntax and the deprecated filters (e.g., `actedIn_SINGLE` and `actedIn_SOME`).
828831

832+
=== List of nullable elements no longer supported
833+
834+
A list of nullable elements is no longer supported in types annotated with the `@node` directive, for example in the following type definition:
835+
836+
[source, graphql, indent=0]
837+
----
838+
type Actor @node {
839+
name: String
840+
pseudonyms: [String]!
841+
}
842+
----
843+
844+
This is due the fact that Neo4j does not support storing null values as part of a list.
845+
To create a similar but supported type definition, change the value of the `pseudonyms` field to a non-nullable list: `[String!]!`.
846+
847+
=== Interfaces and unions disallow mixing types with and without the `@node` directive
848+
849+
Interfaces and unions can only be implemented by types that are all annotated with the `@node` directive or none of them.
850+
851+
Type definitions like the following are no longer supported because the `Series` type is missing the `@node` directive:
852+
853+
[source, graphql, indent=0]
854+
----
855+
interface Production @node {
856+
title: String
857+
}
858+
type Movie @node implements Production {
859+
title: String
860+
}
861+
type Series implements Production {
862+
title: String
863+
}
864+
----
865+
866+
=== Relationship fields require `@node` types
867+
868+
The `@relationship` directive can only be applied to fields whose types are annotated with the `@node` directive.
869+
870+
This also applies to fields defined as interfaces and unions where they must be implemented exclusively by `@node` types.
871+
829872

830873
== Deprecations
831874

832875
=== Deprecated mutations operators outside dedicated input
833876

834-
The following operators:
877+
The following operators are now deprecated:
835878

836879
- `_SET`
837880
- `_POP`
@@ -843,7 +886,7 @@ The following operators:
843886
- `_MULTIPLY`
844887
- `_DIVIDE`
845888

846-
are now deprecated. You should now use the dedicated input object versions:
889+
Use the dedicated input object versions instead:
847890

848891
[cols="1,1"]
849892
|===
@@ -893,7 +936,8 @@ const neoSchema = new Neo4jGraphQL({
893936

894937
=== Deprecated the _EQ filter syntax
895938

896-
The `_EQ` filter syntax is now deprecated. You should now use the dedicated input object versions:
939+
The `_EQ` filter syntax is now deprecated.
940+
Use the dedicated input object versions instead:
897941

898942
[cols="1,1"]
899943
|===
@@ -933,7 +977,8 @@ const neoSchema = new Neo4jGraphQL({
933977

934978
=== Deprecated aggregation filters outside connection fields
935979

936-
The aggregation filters outside connection fields are now deprecated. You should use the aggregation filters within connection input fields instead:
980+
The aggregation filters outside connection fields are now deprecated.
981+
Use the aggregation filters within connection input fields instead:
937982

938983
[cols="1,1"]
939984
|===
@@ -971,9 +1016,10 @@ const neoSchema = new Neo4jGraphQL({
9711016
});
9721017
----
9731018

974-
=== Deprecated Aggregation filters outside dedicated input
1019+
=== Deprecated aggregation filters outside dedicated input
9751020

976-
Aggregation filters outside dedicated input like `_AVERAGE_GT` are now deprecated. You should use the dedicated input object versions:
1021+
Aggregation filters outside dedicated input like `_AVERAGE_GT` are now deprecated.
1022+
Use the dedicated input object versions instead:
9771023

9781024
[cols="1,1"]
9791025
|===
@@ -1019,7 +1065,8 @@ const neoSchema = new Neo4jGraphQL({
10191065

10201066
=== Deprecated relationship filters outside dedicated input
10211067

1022-
The relationship filtering syntax outside dedicated input like `_SOME`, `_ALL`, and `_NONE` is now deprecated. You should use the dedicated input object versions:
1068+
The relationship filtering syntax outside dedicated input like `_SOME`, `_ALL`, and `_NONE` is now deprecated.
1069+
Use the dedicated input object versions instead:
10231070

10241071
[cols="1,1"]
10251072
|===

0 commit comments

Comments
 (0)