DOCS GraphQL filter plugin

See https://github.com/silverstripe/silverstripe-cms/pull/2620

[skip ci]
This commit is contained in:
Ingo Schommer 2020-12-08 13:50:01 +13:00
parent a9f9de167a
commit 835284fdfe

View File

@ -296,24 +296,9 @@ modelConfig:
### The getByLink plugin
When the `silverstripe/cms` module is installed (it is in most cases), a plugin called `getByLink`
will ensure that queries that return a single DataObject model (e.g. readOne) get a new filter argument
will ensure that queries that return a single DataObject model (e.g. readOne) get a new query argument
called `link` (configurable on the `field_name` property of `LinkablePlugin`).
When the `filter` plugin is also activated for the query (it is by default for readOne), the `link` field will be added to the filter
input type. Note that all other filters won't apply in this case, as `link`, like `id`, is exclusive
by definition.
If the `filter` plugin is not activated for the query, a new `link` argument will be added to the query
on its own.
With the standard `filter` plugin applied:
```graphql
readOneSiteTree(filter: { link: "/about-us" }) {
title
}
```
When the `filter` plugin is disabled:
```graphql
readOneSiteTree(link: "/about-us" ) {
title