Skip to content

Commit

Permalink
docs(query-core): add matchQuery and matchMutation utils (#7643)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Jul 18, 2024
1 parent d8ab552 commit 81ca333
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/framework/react/guides/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,21 @@ A mutation filter object supports the following properties:
- Allows for filtering mutations according to their status.
- `predicate?: (mutation: Mutation) => boolean`
- 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.

## Utils

### `matchQuery`

```tsx
const isMatching = matchQuery(filters, query)
```

Returns a boolean that indicates whether a query matches the provided set of query filters.

### `matchMutation`

```tsx
const isMatching = matchMutation(filters, mutation)
```

Returns a boolean that indicates whether a mutation matches the provided set of mutation filters.

0 comments on commit 81ca333

Please sign in to comment.