From 6984cf95bfd40d2734fd5024173efc2dc9292539 Mon Sep 17 00:00:00 2001 From: Ben Longo Date: Mon, 21 Nov 2022 14:42:10 -0500 Subject: [PATCH 1/3] docs: clarify interaction of query filter predicates with other criteria --- docs/guides/filters.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guides/filters.md b/docs/guides/filters.md index 1de642b603..d8965014d7 100644 --- a/docs/guides/filters.md +++ b/docs/guides/filters.md @@ -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 a final filter on all matched queries. If no other criteria are specified, this function will be evaluated on every query in the cache. ## `Mutation Filters` @@ -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 a final filter on all matched queries. If no other criteria are specified, this function will be evaluated on every mutation in the cache. From 51736ef9b616fa8c407d832c7988cb578fec2945 Mon Sep 17 00:00:00 2001 From: Ben Longo Date: Sun, 27 Nov 2022 12:45:46 -0500 Subject: [PATCH 2/3] Update docs/guides/filters.md Co-authored-by: Dominik Dorfmeister --- docs/guides/filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/filters.md b/docs/guides/filters.md index d8965014d7..8c1e1942ea 100644 --- a/docs/guides/filters.md +++ b/docs/guides/filters.md @@ -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 used a final filter on all matched queries. If no other criteria are specified, this function will be evaluated on every query in the cache. + - 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` From 6a316667b49a12ef5b2bd74701943a9fe2277156 Mon Sep 17 00:00:00 2001 From: Ben Longo Date: Sun, 27 Nov 2022 12:45:51 -0500 Subject: [PATCH 3/3] Update docs/guides/filters.md Co-authored-by: Dominik Dorfmeister --- docs/guides/filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/filters.md b/docs/guides/filters.md index 8c1e1942ea..ee0226d73e 100644 --- a/docs/guides/filters.md +++ b/docs/guides/filters.md @@ -70,4 +70,4 @@ A mutation filter object supports the following properties: - 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 used a final filter on all matched queries. If no other criteria are specified, this function will be evaluated on every mutation in the cache. + - 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.