mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
DOCS GraphQL filter plugin
See https://github.com/silverstripe/silverstripe-cms/pull/2620 [skip ci]
This commit is contained in:
parent
a9f9de167a
commit
835284fdfe
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user