Skip to content

Commit

Permalink
docs: clarify interaction of query filter predicates with other crite…
Browse files Browse the repository at this point in the history
…ria (#4532)

* docs: clarify interaction of query filter predicates with other criteria

* Update docs/guides/filters.md

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

* Update docs/guides/filters.md

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
  • Loading branch information
benlongo and TkDodo committed Jan 13, 2023
1 parent 6772333 commit 3a3d871
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/react/guides/filters.md
Expand Up @@ -41,7 +41,7 @@ A query filter object supports the following properties:
- When set to `paused` it will match queries that wanted to fetch, but have been `paused`.
- When set to `idle` it will match queries that are not fetching.
- `predicate?: (query: Query) => boolean`
- This predicate function will be called for every single query in the cache and be expected to return truthy for queries that are `found`.
- This predicate function will be used as a final filter on all matching queries. If no other filters are specified, this function will be evaluated against every query in the cache.

## `Mutation Filters`

Expand All @@ -62,12 +62,12 @@ await queryClient.isMutating({

A mutation filter object supports the following properties:

- `mutationKey?: MutationKey`
- Set this property to define a mutation key to match on.
- `exact?: boolean`
- If you don't want to search mutations inclusively by mutation key, you can pass the `exact: true` option to return only the mutation with the exact mutation key you have passed.
- `fetching?: boolean`
- When set to `true` it will match mutations that are currently fetching.
- When set to `false` it will match mutations that are not fetching.
- `predicate?: (mutation: Mutation) => boolean`
- This predicate function will be called for every single mutation in the cache and be expected to return truthy for mutations that are `found`.
- `mutationKey?: MutationKey`
- Set this property to define a mutation key to match on.
- This predicate function will be used as a final filter on all matching mutations. If no other filters are specified, this function will be evaluated against every mutation in the cache.

0 comments on commit 3a3d871

Please sign in to comment.