Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions modules/ROOT/pages/migration/v4-migration/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,26 @@ However, if using TypeScript, the exported interface to implement these classes

We have renamed a number of directives and their arguments, in order to make using `@neo4j/graphql` more intuitive.

=== `@queryOptions` removed and `limit` argument moved to `@limit`

If you were using the `@queryOptions` directive to configure the default and max values for limiting the data returned by queries, for instance:

[source, graphql, indent=0]
----
type Record @queryOptions(limit: { default: 10, max: 100 }) {
id: ID!
}
----

This is now achieved by using the `@limit` directive:

[source, graphql, indent=0]
----
type Record @limit(default: 10, max: 100) {
id: ID!
}
----

[populatedBy-migration]
=== `@callback` renamed to `@populatedBy`

Expand Down
20 changes: 8 additions & 12 deletions modules/ROOT/pages/reference/directives/default-values.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,23 @@ type Movie {
}
----

[[type-definitions-default-values-queryoptions]]
== `@queryOptions`
[[type-definitions-default-values-limit]]
== `@limit`

The `@queryOptions` is to be used on nodes, where applied will inject values into a query such as the `limit`.
The `@limit` is to be used on nodes, where applied will inject values into a query such as the `limit`.

=== Definition

[source, graphql, indent=0]
----
"""The `@queryOptions` is to be used on nodes, where applied will inject values into a query such as the `limit`."""
directive @queryOptions(
"""If no limit argument is supplied on query will fallback to this value."""
limit: {
default: Int
max: Int
}
"""The `@limit` is to be used on nodes, where applied will inject values into a query such as the `limit`."""
directive @limit(
default: Int
max: Int
) on OBJECT
----

=== Limit
Limit has 2 arguments:
The directive has two arguments:

* `default` - If no `limit` argument is passed to the query, the default limit will be used. The query may still pass a higher or lower `limit`.
* `max` - Defines the maximum limit to be passed to the query. If a higher value is passed, this will be used instead. If no `default` value is set, `max` will be used for queries without limit.
12 changes: 6 additions & 6 deletions modules/ROOT/pages/reference/directives/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ The `@id` directive marks a field as the unique ID for an object type, and allow

Reference: xref::reference/directives/autogeneration.adoc#type-definitions-autogeneration-id[`@id`]

== `@limit`

The `@limit` is to be used on nodes, and when applied will inject values into Cypher `LIMIT` clauses.

Reference: xref::reference/directives/default-values.adoc#type-definitions-default-values-limit[`@limit`]

== `@mutation`

This directive is used to limit the availability of Mutation operations in the library.
Expand Down Expand Up @@ -101,12 +107,6 @@ This directive is used to limit the availability of Query operations in the libr

Reference: xref:reference/directives/schema-configuration/type-configuration.adoc#_query[`@query`]

== `@queryOptions`

The `@queryOptions` is to be used on nodes, where applied will inject values into a query such as the `limit`.

Reference: xref::reference/directives/default-values.adoc#type-definitions-default-values-queryoptions[`@queryOptions`]

== `@relationship`

The `@relationship` directive is used to configure relationships between object types.
Expand Down