diff --git a/modules/ROOT/pages/directives/schema-configuration/field-configuration.adoc b/modules/ROOT/pages/directives/schema-configuration/field-configuration.adoc index 76fa252b..335d6618 100644 --- a/modules/ROOT/pages/directives/schema-configuration/field-configuration.adoc +++ b/modules/ROOT/pages/directives/schema-configuration/field-configuration.adoc @@ -27,7 +27,7 @@ It generates the type `Actor`: type Actor { name: String! age: Int - actedIn(where: MovieWhere, options: MovieOptions, directed: Boolean = true): [Movie!]! + actedIn(where: MovieWhere, sort: [MovieSort!]!, limit: Int, offset: Int, directed: Boolean = true): [Movie!]! actedInAggregate(where: MovieWhere, directed: Boolean = true): ActorMovieActedInAggregationSelection actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection! } @@ -56,7 +56,7 @@ Now the type `Actor` looks like this: ---- type Actor { name: String! - actedIn(where: MovieWhere, options: MovieOptions, directed: Boolean = true): [Movie!]! + actedIn(where: MovieWhere, sort: [MovieSort!]!, limit: Int, offset: Int, directed: Boolean = true): [Movie!]! actedInAggregate(where: MovieWhere, directed: Boolean = true): ActorMovieActedInAggregationSelection actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection! } @@ -105,7 +105,7 @@ From the previous type definitions, the type `Actor` produced is: ---- type Actor { name: String! - actedIn(where: MovieWhere, options: MovieOptions, directed: Boolean = true): [Movie!]! + actedIn(where: MovieWhere, sort: [MovieSort!]!, limit: Int, offset: Int, directed: Boolean = true): [Movie!]! actedInAggregate(where: MovieWhere, directed: Boolean = true): ActorMovieActedInAggregationSelection actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection! } @@ -135,7 +135,7 @@ In this case, as the argument `aggregate` was passed as false, the type `Actor` type Actor { name: String! age: Int - actedIn(where: MovieWhere, options: MovieOptions, directed: Boolean = true): [Movie!]! + actedIn(where: MovieWhere, sort: [MovieSort!]!, limit: Int, offset: Int, directed: Boolean = true): [Movie!]! actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection! } ---- @@ -269,7 +269,7 @@ From the previous type definitions, the type `Actor` produced is: ---- type Actor { name: String! - actedIn(where: MovieWhere, options: MovieOptions, directed: Boolean = true): [Movie!]! + actedIn(where: MovieWhere, sort: [MovieSort!]!, limit: Int, offset: Int, directed: Boolean = true): [Movie!]! actedInAggregate(where: MovieWhere, directed: Boolean = true): ActorMovieActedInAggregationSelection actedInConnection(where: ActorActedInConnectionWhere, first: Int, after: String, directed: Boolean = true, sort: [ActorActedInConnectionSort!]): ActorActedInConnection! } @@ -437,7 +437,7 @@ input MovieWhere { OR: [MovieWhere!] AND: [MovieWhere!] NOT: MovieWhere - title: String + title_EQ: String title_IN: [String!] title_CONTAINS: String title_STARTS_WITH: String @@ -507,7 +507,7 @@ input MovieWhere { OR: [MovieWhere!] AND: [MovieWhere!] NOT: MovieWhere - title: String + title_EQ: String title_IN: [String!] title_CONTAINS: String title_STARTS_WITH: String diff --git a/modules/ROOT/pages/optimization.adoc b/modules/ROOT/pages/optimization.adoc index aaacde38..421eafe8 100644 --- a/modules/ROOT/pages/optimization.adoc +++ b/modules/ROOT/pages/optimization.adoc @@ -23,13 +23,13 @@ const neoSchema = new Neo4jGraphQL({ driver, features: { excludeDeprecatedFields: { - bookmark: true, - negationFilters: true, - arrayFilters: true, - stringAggregation: true, - aggregationFilters: true, + implicitEqualFilters: true; + deprecatedOptionsArgument: true; + directedArgument: true; }, }, }); ``` +; + diff --git a/modules/ROOT/pages/queries-aggregations/aggregations.adoc b/modules/ROOT/pages/queries-aggregations/aggregations.adoc index a9885bb1..0419e154 100644 --- a/modules/ROOT/pages/queries-aggregations/aggregations.adoc +++ b/modules/ROOT/pages/queries-aggregations/aggregations.adoc @@ -33,10 +33,10 @@ For which the following query fields are generated: [source, graphql, indent=0] ---- type Query { - posts(where: PostWhere, options: PostOptions): [Post!]! + posts(where: PostWhere, sort: [PostSort!]!, limit: Int, offset: Int,): [Post!]! postsAggregate(where: PostWhere): PostAggregationSelection! - users(where: UserWhere, options: UserOptions): [User!]! + users(where: UserWhere, sort: [UserSort!]!, limit: Int, offset: Int,): [User!]! usersAggregate(where: UserWhere): UserAggregationSelection! } ---- @@ -180,17 +180,3 @@ query { } ---- -When performing an aggregation on related nodes, the query against the relationship -can be defined as "undirected" by using the argument `directed: false`: - -[source, graphql, indent=0] ----- -query { - users { - id - postsAggregate(directed: false) { - count - } - } -} ----- diff --git a/modules/ROOT/pages/queries-aggregations/pagination/offset-based.adoc b/modules/ROOT/pages/queries-aggregations/pagination/offset-based.adoc index a2afd5a1..9cc6ac91 100644 --- a/modules/ROOT/pages/queries-aggregations/pagination/offset-based.adoc +++ b/modules/ROOT/pages/queries-aggregations/pagination/offset-based.adoc @@ -18,9 +18,7 @@ You would fetch the first "page" of 10 by executing: [source, graphql, indent=0] ---- query { - users(options: { - limit: 10 - }) { + users(limit: 10) { name } } @@ -33,10 +31,7 @@ And then on subsequent calls, introduce the `offset` argument and increment it b [source, graphql, indent=0] ---- query { - users(options: { - offset: 10 - limit: 10 - }) { + users(offset: 10, limit: 10) { name } } @@ -47,10 +42,7 @@ query { [source, graphql, indent=0] ---- query { - users(options: { - offset: 20 - limit: 10 - }) { + users(offset: 20, limit: 10) { name } } @@ -75,10 +67,7 @@ query { name_EQ: "Billy" }) { name - posts(options: { - offset: 20 - limit: 10 - }) { + posts(offset: 20, limit: 10) { content } } diff --git a/modules/ROOT/pages/queries-aggregations/queries.adoc b/modules/ROOT/pages/queries-aggregations/queries.adoc index d0cb68ab..0f444155 100644 --- a/modules/ROOT/pages/queries-aggregations/queries.adoc +++ b/modules/ROOT/pages/queries-aggregations/queries.adoc @@ -33,10 +33,10 @@ For which the following query fields are generated: [source, graphql, indent=0] ---- type Query { - posts(where: PostWhere, options: PostOptions): [Post!]! + posts(where: PostWhere, sort: [PostSort!]!, limit: Int, offset: Int,): [Post!]! postsAggregate(where: PostWhere): PostAggregationSelection! - users(where: UserWhere, options: UserOptions): [User!]! + users(where: UserWhere, sort: [UserSort!]!, limit: Int, offset: Int,): [User!]! usersAggregate(where: UserWhere): UserAggregationSelection! } ---- @@ -69,45 +69,3 @@ query { } } ---- - -== Undirected queries - -All xref::/types/relationships.adoc[relationships] are created with a direction from one node to another. -By default, all queries follow the direction defined in the relationship. -However, in some cases it is necessary to query for all related nodes, regardless of the direction of the relationship. -This can be achieved with the argument `directed: false`. - -For example, the following query should return all User friends, regardless of the direction of the relationship `"FRIENDS_WITH"`: - -[source, graphql, indent=0] ----- -query { - users { - name - friends: friends(directed: false) { - name - } - } -} ----- - -In addition, undirected relationships can also be used in the same fashion with connections. -For instance, this query is asking for a list of users and their friends' names with an undirected friendship connection: - -[source, graphql, indent=0] ----- -query Query { - users { - friendsConnection(directed: false) { - edges { - node { - name - } - } - } - } -} ----- - -Keep in mind that *undirected relationships are only supported in queries*. -The xref::/types/relationships.adoc#_querydirection[type definitions] for a relationship may define a different behavior, so the `directed` option may not be available in some cases. \ No newline at end of file diff --git a/modules/ROOT/pages/queries-aggregations/sorting.adoc b/modules/ROOT/pages/queries-aggregations/sorting.adoc index 857b77f8..1b5797ce 100644 --- a/modules/ROOT/pages/queries-aggregations/sorting.adoc +++ b/modules/ROOT/pages/queries-aggregations/sorting.adoc @@ -35,15 +35,8 @@ input MovieSort { runtime: SortDirection } -input MovieOptions { - """Specify one or more MovieSort objects to sort Movies by. The sorts will be applied in the order in which they are arranged in the array.""" - sort: [MovieSort!] - limit: Int - offset: Int -} - type Query { - movies(where: MovieWhere, options: MovieOptions): [Movie!]! + movies(where: MovieWhere, sort: [MovieSort!], limit: Int, offset: Int): [Movie!]! } ---- @@ -52,13 +45,12 @@ The following query fetches all movies sorted by runtime in ascending order: [source, graphql, indent=0] ---- query { - movies(options: { - sort: [ + movies(sort: [ { runtime: ASC } ] - }) { + ) { title runtime } @@ -73,13 +65,12 @@ query { movies { title runtime - actors(options: { - sort: [ + actors(sort: [ { surname: ASC } ] - }) { + ) { surname } }