You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It was possible to define schemas with types that have multiple relationship fields connected by the same type of relationships. Instances of this scenario are now detected during schema generation and an error is thrown so developers are informed to remedy the type definitions.
6
+
7
+
An example of what is now considered invalid with these checks:
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/guides/v4-migration/index.adoc
+52-1Lines changed: 52 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -526,12 +526,48 @@ type User {
526
526
}
527
527
----
528
528
529
+
=== Duplicate relationship fields are now checked for
530
+
531
+
It was possible to define schemas with types that have multiple relationship fields connected by the same type of relationships. Instances of this scenario are now detected during schema generation and an error is thrown so developers are informed to remedy the type definitions.
532
+
533
+
An example of what is now considered invalid with these checks:
In this example, there are multiple fields in the `Team` type which have the same `Person` type, the same `@relationship` type and ("PLAYS_IN") direction (IN). This is an issue when returning data from the database, as there would be no difference between `player1`, `player2` and `backupPlayers`. Selecting these fields would then return the same data.
549
+
550
+
To disable checks for duplicate relationship fields, the `noDuplicateRelationshipFields` config option should be used:
551
+
552
+
[source, javascript, indent=0]
553
+
----
554
+
const neoSchema = new Neo4jGraphQL({
555
+
typeDefs,
556
+
config: {
557
+
startupValidation: {
558
+
noDuplicateRelationshipFields: false,
559
+
},
560
+
},
561
+
});
562
+
----
563
+
564
+
529
565
== Miscellaneous changes
530
566
531
567
[[startup-validation]]
532
568
=== Startup validation
533
569
534
-
In version 4.0.0, startup xref::guides/v4-migration/index.adoc#customResolver-checks[checks for custom resolvers] have been added. As a result, a new configuration option has been added that can disable these checks.
570
+
In version 4.0.0, startup xref::guides/v4-migration/index.adoc#customResolver-checks[checks for custom resolvers], and checks for duplicate relationship fields have been added. As a result, a new configuration option has been added that can disable these checks.
535
571
This new option has been combined with the option to `skipValidateTypeDefs`. As a result, `skipValidateTypeDefs` will be removed and replaced by `startupValidation`.
536
572
537
573
To only disable strict type definition validation, the following config option should be used:
@@ -562,6 +598,21 @@ const neoSchema = new Neo4jGraphQL({
562
598
})
563
599
----
564
600
601
+
To only disable checks for duplicate relationship fields, the following config option should be used:
602
+
603
+
[source, javascript, indent=0]
604
+
----
605
+
const neoSchema = new Neo4jGraphQL({
606
+
typeDefs,
607
+
config: {
608
+
startupValidation: {
609
+
noDuplicateRelationshipFields: false
610
+
},
611
+
},
612
+
})
613
+
----
614
+
615
+
565
616
To disable all startup checks, the following config option should be used:
0 commit comments