Skip to content

Commit 8d81c22

Browse files
committed
Add default behavior for GraphQL operations in Filters section
1 parent ca5e0e8 commit 8d81c22

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/graphql.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Filters are supported out-of-the-box. Follow the [filters](filters.md) documenta
4040
However you don't necessarily have the same needs for your GraphQL endpoint as for your REST one.
4141

4242
In the `ApiResource` declaration, you can choose to decorrelate the GraphQL filters in `query` of the `graphql` attribute.
43+
In order to keep the default behavior (possibility to fetch, delete, update or create), define all the operations (`query`, `delete`, `update` and `create`).
4344

4445
For example, this entity will have a search filter for REST and a date filter for GraphQL:
4546

@@ -59,7 +60,10 @@ use ApiPlatform\Core\Annotation\ApiResource;
5960
* graphql={
6061
* "query"={
6162
* "filters"={"offer.date_filter"}
62-
* }
63+
* },
64+
* "delete"={},
65+
* "update"={},
66+
* "create"={}
6367
* }
6468
* )
6569
*/

0 commit comments

Comments
 (0)