Skip to content

Commit 81ca333

Browse files
robin4a4TkDodolachlancollins
authoredJul 18, 2024
docs(query-core): add matchQuery and matchMutation utils (#7643)
* docs(query-core): add matchQuery and matchMutation mentions in filters documentation * docs(query-core): clarifies filters type * Format --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
1 parent d8ab552 commit 81ca333

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

‎docs/framework/react/guides/filters.md

+18
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,21 @@ A mutation filter object supports the following properties:
7070
- Allows for filtering mutations according to their status.
7171
- `predicate?: (mutation: Mutation) => boolean`
7272
- 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.
73+
74+
## Utils
75+
76+
### `matchQuery`
77+
78+
```tsx
79+
const isMatching = matchQuery(filters, query)
80+
```
81+
82+
Returns a boolean that indicates whether a query matches the provided set of query filters.
83+
84+
### `matchMutation`
85+
86+
```tsx
87+
const isMatching = matchMutation(filters, mutation)
88+
```
89+
90+
Returns a boolean that indicates whether a mutation matches the provided set of mutation filters.

0 commit comments

Comments
 (0)