Skip to content

Commit 6a7d417

Browse files
authored
Merge branch '7.x' into release-prep-for-7.x
2 parents 50bac6c + de1ac18 commit 6a7d417

30 files changed

+593
-623
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ type Mutation {
261261

262262
== `@coalesce`
263263

264-
When translating from GraphQL to Cypher, any instances of fields to which this directive is applied will be wrapped in a `coalesce()` function in the WHERE clause.
264+
When translating from GraphQL to Cypher, any instances of fields to which this directive is applied will be wrapped in a `coalesce()` function in the WHERE and RETURN clause.
265265
For more information, see link:https://neo4j.com/developer/kb/understanding-non-existent-properties-and-null-values/#_use_coalesce_to_use_a_default_for_a_null_value[Understanding non-existent properties and working with nulls].
266266

267267
This directive helps querying against non-existent properties in a database.

modules/ROOT/pages/directives/database-mapping.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,12 @@ To add two node types, "Movie" and "Actor", and connect the two:
218218

219219
[source, graphql, indent=0]
220220
----
221-
type Movie {
221+
type Movie @node {
222222
title: String
223223
actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN)
224224
}
225225
226-
type Actor {
226+
type Actor @node {
227227
name: String
228228
movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT)
229229
}
@@ -258,12 +258,12 @@ For example, for the "ACTED_IN" relationship, add a property "roles":
258258

259259
[source, graphql, indent=0]
260260
----
261-
type Movie {
261+
type Movie @node {
262262
title: String
263263
actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN, properties: "ActedIn")
264264
}
265265
266-
type Actor {
266+
type Actor @node {
267267
name: String
268268
movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, properties: "ActedIn")
269269
}

modules/ROOT/pages/directives/index.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ Particularly useful for types that are not correctly pluralized or are non-Engli
108108
| xref::/directives/indexes-and-constraints.adoc#_fulltext[`@fulltext`]
109109
| Indicates that there should be a fulltext index inserted into the database for the specified Node and its properties.
110110

111-
| xref::/directives/indexes-and-constraints.adoc#_unique[`@unique`]
112-
| Indicates that there should be a uniqueness constraint in the database for the fields that it is applied to.
113111

114112
| xref::/directives/indexes-and-constraints.adoc#_vector_index_search[`@vector`]
115113
| Perform a vector index search on your database either based by passing in a vector index or a search phrase.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ For example:
1616
[source, graphql, indent=0]
1717
----
1818
input FullTextInput {
19-
indexName: String
20-
queryName: String
19+
indexName: String!
20+
queryName: String!
2121
fields: [String]!
2222
}
2323

modules/ROOT/pages/directives/schema-configuration/field-configuration.adoc

Lines changed: 40 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ type Actor {
2828
name: String!
2929
age: Int
3030
actedIn(where: MovieWhere, sort: [MovieSort!]!, limit: Int, offset: Int, directed: Boolean = true): [Movie!]!
31-
actedInAggregate(where: MovieWhere, directed: Boolean = true): ActorMovieActedInAggregationSelection
3231
actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection!
3332
}
3433
----
@@ -57,14 +56,13 @@ Now the type `Actor` looks like this:
5756
type Actor {
5857
name: String!
5958
actedIn(where: MovieWhere, sort: [MovieSort!]!, limit: Int, offset: Int, directed: Boolean = true): [Movie!]!
60-
actedInAggregate(where: MovieWhere, directed: Boolean = true): ActorMovieActedInAggregationSelection
6159
actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection!
6260
}
6361
----
6462

6563
== `@relationship`
6664

67-
There are several nested operations available for every field created using the `@relationship` directive. These are `create`, `connect`, `disconnect`, `connectOrCreate`, and `delete`.
65+
There are several nested operations available for every field created using the `@relationship` directive. These are `create`, `connect`, `disconnect`, and `delete`.
6866

6967
However, these operations are not always needed.
7068
The `@relationship` directive allows you to define which operations should be available for a relationship by using the argument `nestedOperations`.
@@ -82,15 +80,14 @@ enum NestedOperations {
8280
DELETE
8381
CONNECT
8482
DISCONNECT
85-
CONNECT_OR_CREATE
8683
}
8784
8885
directive @relationship(
8986
type: String!
9087
queryDirection: RelationshipQueryDirection! = DEFAULT_DIRECTED
9188
direction: RelationshipDirection!
9289
properties: String
93-
nestedOperations: [NestedOperations!]! = [CREATE, UPDATE, DELETE, CONNECT, DISCONNECT, CONNECT_OR_CREATE]
90+
nestedOperations: [NestedOperations!]! = [CREATE, UPDATE, DELETE, CONNECT, DISCONNECT]
9491
aggregate: Boolean! = true
9592
) on FIELD_DEFINITION
9693
----
@@ -99,19 +96,25 @@ directive @relationship(
9996

10097
*Configure aggregation*
10198

102-
From the previous type definitions, the type `Actor` produced is:
99+
From the previous type definitions, the types related to `Actor` produced are:
103100

104101
[source, graphql, indent=0]
105102
----
106103
type Actor {
107104
name: String!
108105
actedIn(where: MovieWhere, sort: [MovieSort!]!, limit: Int, offset: Int, directed: Boolean = true): [Movie!]!
109-
actedInAggregate(where: MovieWhere, directed: Boolean = true): ActorMovieActedInAggregationSelection
110106
actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection!
111107
}
108+
109+
type ActorActedInConnection {
110+
edges: [ActorActedInRelationship!]!
111+
totalCount: Int!
112+
pageInfo: PageInfo!
113+
aggregate: ActorMovieActedInAggregateSelection!
114+
}
112115
----
113116

114-
Note that the relationship field `actedIn` produces the operation field `actedInAggregate`, which allows aggregations on that relationship.
117+
Note that the relationship field `actedIn` produces the operation field `aggregate` in the type `ActorActedInConnection`, which allows aggregations on that relationship.
115118
It is possible to configure this behavior by passing the argument aggregate on the `@relationship` directive:
116119

117120
[source, graphql, indent=0]
@@ -128,15 +131,14 @@ type Actor @node {
128131
}
129132
----
130133

131-
In this case, as the argument `aggregate` was passed as false, the type `Actor` produced is:
134+
In this case, as the argument `aggregate` was passed as false, the type `ActorActedInConnection` produced is:
132135

133136
[source, graphql, indent=0]
134137
----
135-
type Actor {
136-
name: String!
137-
age: Int
138-
actedIn(where: MovieWhere, sort: [MovieSort!]!, limit: Int, offset: Int, directed: Boolean = true): [Movie!]!
139-
actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection!
138+
type ActorActedInConnection {
139+
edges: [ActorActedInRelationship!]!
140+
totalCount: Int!
141+
pageInfo: PageInfo!
140142
}
141143
----
142144

@@ -155,7 +157,6 @@ enum NestedOperations {
155157
DELETE
156158
CONNECT
157159
DISCONNECT
158-
CONNECT_OR_CREATE
159160
}
160161
----
161162

@@ -176,7 +177,7 @@ type Movie @node {
176177
type Actor @node {
177178
name: String!
178179
age: Int
179-
actedIn: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, nestedOperations: [UPDATE, DELETE, CONNECT, DISCONNECT, CONNECT_OR_CREATE])
180+
actedIn: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT, nestedOperations: [UPDATE, DELETE, CONNECT, DISCONNECT])
180181
}
181182
----
182183

@@ -242,14 +243,13 @@ Aggregations, however, are available on both:
242243

243244
[source, graphql, indent=0]
244245
----
245-
type MovieAggregateSelection {
246-
count: Int!
247-
description: StringAggregateSelectionNullable!
248-
title: StringAggregateSelectionNonNullable!
246+
type MovieAggregateNode {
247+
title: StringAggregateSelection!
248+
description: StringAggregateSelection!
249249
}
250250
----
251251

252-
In case you want to remove the `description` field from `MovieAggregateSelection`, you need to change the `onAggregate` value to `false`:
252+
In case you want to remove the `description` field from `MovieAggregateNode`, you need to change the `onAggregate` value to `false`:
253253

254254
[source, graphql, indent=0]
255255
----
@@ -270,7 +270,6 @@ From the previous type definitions, the type `Actor` produced is:
270270
type Actor {
271271
name: String!
272272
actedIn(where: MovieWhere, sort: [MovieSort!]!, limit: Int, offset: Int, directed: Boolean = true): [Movie!]!
273-
actedInAggregate(where: MovieWhere, directed: Boolean = true): ActorMovieActedInAggregationSelection
274273
actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection!
275274
}
276275
----
@@ -300,12 +299,17 @@ Generate the type `Actor`:
300299
----
301300
type Actor {
302301
name: String!
303-
actedInAggregate(where: MovieWhere, directed: Boolean = true): ActorMovieActedInAggregationSelection
302+
actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection!
303+
}
304+
305+
type ActorActedInConnection {
306+
aggregate: ActorMovieActedInAggregateSelection!
304307
}
305308
----
306309

307-
Note how `actedInAggregate` is not affected by the argument `onAggregate`.
308-
To disable the generation of `actedInAggregate`, see the `aggregate` argument of the directive xref::/schema-configuration/field-configuration.adoc#_relationship[`@relationship`].
310+
Note how the `aggregate` field is still present on the `ActorActedInConnection` type, and not affected by the argument `onAggregate`.
311+
312+
To disable the generation of the `aggregate` field, see the `aggregate` argument of the xref::/schema-configuration/field-configuration.adoc#_relationship[`@relationship` directive].
309313

310314
== `@settable`
311315

@@ -351,7 +355,7 @@ input MovieCreateInput {
351355
}
352356
353357
input MovieUpdateInput {
354-
title: String
358+
title: StringScalarMutations
355359
}
356360
----
357361

@@ -387,12 +391,12 @@ input ActorCreateInput {
387391
}
388392
389393
input ActorUpdateInput {
390-
name: String
394+
name: StringScalarMutations
391395
actedIn: [ActorActedInUpdateFieldInput!]
392396
}
393397
----
394398

395-
This means `actedIn` can be updated on an update, but it is no longer available on `create`` operations.
399+
This means `actedIn` can be updated on an update, but it is no longer available on `create` operations.
396400

397401
== `@filterable`
398402

@@ -437,41 +441,17 @@ input MovieWhere {
437441
OR: [MovieWhere!]
438442
AND: [MovieWhere!]
439443
NOT: MovieWhere
440-
title_EQ: String
441-
title_IN: [String!]
442-
title_CONTAINS: String
443-
title_STARTS_WITH: String
444-
title_ENDS_WITH: String
445-
actorsAggregate: MovieActorsAggregateInput
446-
actors_ALL: ActorWhere
447-
actors_NONE: ActorWhere
448-
actors_SINGLE: ActorWhere
449-
actors_SOME: ActorWhere
450-
actorsConnection_ALL: MovieActorsConnectionWhere
451-
actorsConnection_NONE: MovieActorsConnectionWhere
452-
actorsConnection_SINGLE: MovieActorsConnectionWhere
453-
actorsConnection_SOME: MovieActorsConnectionWhere
444+
title: StringScalarFilters
445+
actors: ActorRelationshipFilters
446+
actorsConnection: MovieActorsConnectionFilters
454447
}
455448
449+
456450
input ActorActedInNodeAggregationWhereInput {
457451
AND: [ActorActedInNodeAggregationWhereInput!]
458452
OR: [ActorActedInNodeAggregationWhereInput!]
459453
NOT: ActorActedInNodeAggregationWhereInput
460-
title_AVERAGE_LENGTH_EQUAL: Float
461-
title_LONGEST_LENGTH_EQUAL: Int
462-
title_SHORTEST_LENGTH_EQUAL: Int
463-
title_AVERAGE_LENGTH_GT: Float
464-
title_LONGEST_LENGTH_GT: Int
465-
title_SHORTEST_LENGTH_GT: Int
466-
title_AVERAGE_LENGTH_GTE: Float
467-
title_LONGEST_LENGTH_GTE: Int
468-
title_SHORTEST_LENGTH_GTE: Int
469-
title_AVERAGE_LENGTH_LT: Float
470-
title_LONGEST_LENGTH_LT: Int
471-
title_SHORTEST_LENGTH_LT: Int
472-
title_AVERAGE_LENGTH_LTE: Float
473-
title_LONGEST_LENGTH_LTE: Int
474-
title_SHORTEST_LENGTH_LTE: Int
454+
title: StringScalarAggregationFilters
475455
}
476456
----
477457

@@ -507,33 +487,16 @@ input MovieWhere {
507487
OR: [MovieWhere!]
508488
AND: [MovieWhere!]
509489
NOT: MovieWhere
510-
title_EQ: String
511-
title_IN: [String!]
512-
title_CONTAINS: String
513-
title_STARTS_WITH: String
514-
title_ENDS_WITH: String
490+
title: StringScalarFilters
515491
}
516492
517493
input ActorActedInNodeAggregationWhereInput {
518494
AND: [ActorActedInNodeAggregationWhereInput!]
519495
OR: [ActorActedInNodeAggregationWhereInput!]
520496
NOT: ActorActedInNodeAggregationWhereInput
521-
title_AVERAGE_LENGTH_EQUAL: Float
522-
title_LONGEST_LENGTH_EQUAL: Int
523-
title_SHORTEST_LENGTH_EQUAL: Int
524-
title_AVERAGE_LENGTH_GT: Float
525-
title_LONGEST_LENGTH_GT: Int
526-
title_SHORTEST_LENGTH_GT: Int
527-
title_AVERAGE_LENGTH_GTE: Float
528-
title_LONGEST_LENGTH_GTE: Int
529-
title_SHORTEST_LENGTH_GTE: Int
530-
title_AVERAGE_LENGTH_LT: Float
531-
title_LONGEST_LENGTH_LT: Int
532-
title_SHORTEST_LENGTH_LT: Int
533-
title_AVERAGE_LENGTH_LTE: Float
534-
title_LONGEST_LENGTH_LTE: Int
535-
title_SHORTEST_LENGTH_LTE: Int
497+
title: StringScalarAggregationFilters
536498
}
499+
537500
----
538501

539502
As shown by the previous inputs fields, the `actors` field is not available for filtering on both value and aggregation filters.

modules/ROOT/pages/directives/schema-configuration/global-configuration.adoc

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,29 @@ type Actor @node {
2323
extend schema @query(read: true, aggregate: false)
2424
----
2525

26-
**Query**
26+
This configuration disables all top-level aggregation operations for the `Movie` and `Actor` types, while still allowing read operations.
2727

28-
* `movies`
29-
* [.line-through]#`moviesAggregate`#
30-
* `moviesConnection`
31-
* `actors`
32-
* [.line-through]#`actorsAggregate`#
33-
* `actorsConnection`
28+
[source, graphql, indent=0]
29+
----
30+
type Query {
31+
moviesConnection(first: Int, after: String, where: MovieWhere, sort: [MovieSort!]): MoviesConnection!
32+
movies(where: MovieWhere, limit: Int, offset: Int, sort: [MovieSort!]): [Movie!]!
33+
actorsConnection(first: Int, after: String, where: ActorWhere, sort: [ActorSort!]): ActorsConnection!
34+
actors(where: ActorWhere, limit: Int, offset: Int, sort: [ActorSort!]): [Actor!]!
35+
}
3436
37+
type MoviesConnection {
38+
edges: [MovieEdge!]!
39+
totalCount: Int!
40+
pageInfo: PageInfo!
41+
}
42+
43+
type ActorsConnection {
44+
edges: [ActorEdge!]!
45+
totalCount: Int!
46+
pageInfo: PageInfo!
47+
}
48+
----
3549

3650
**Invalid schema usage**
3751

0 commit comments

Comments
 (0)