Skip to content

Commit 3a3d871

Browse files
benlongoTkDodo
andauthored
docs: clarify interaction of query filter predicates with other criteria (#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>
1 parent 6772333 commit 3a3d871

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/react/guides/filters.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ A query filter object supports the following properties:
4141
- When set to `paused` it will match queries that wanted to fetch, but have been `paused`.
4242
- When set to `idle` it will match queries that are not fetching.
4343
- `predicate?: (query: Query) => boolean`
44-
- This predicate function will be called for every single query in the cache and be expected to return truthy for queries that are `found`.
44+
- 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.
4545

4646
## `Mutation Filters`
4747

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

6363
A mutation filter object supports the following properties:
6464

65+
- `mutationKey?: MutationKey`
66+
- Set this property to define a mutation key to match on.
6567
- `exact?: boolean`
6668
- 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.
6769
- `fetching?: boolean`
6870
- When set to `true` it will match mutations that are currently fetching.
6971
- When set to `false` it will match mutations that are not fetching.
7072
- `predicate?: (mutation: Mutation) => boolean`
71-
- This predicate function will be called for every single mutation in the cache and be expected to return truthy for mutations that are `found`.
72-
- `mutationKey?: MutationKey`
73-
- Set this property to define a mutation key to match on.
73+
- 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 commit comments

Comments
 (0)