Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/framework/react/guides/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@ A mutation filter object supports the following properties:
- `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.

## `Cancel Options`

Cancel options are used to control the behavior of query cancellation operations.

```tsx
// Cancel specific queries silently
await queryClient.cancelQueries(
{ queryKey: ['posts'] },
{ silent: true }
)
```

A cancel options object supports the following properties:

- `silent?: boolean`
- When set to `true`, prevents `CancelledError` from being thrown during query cancellation.
- Defaults to `false`
- `revert?: boolean`
- When set to `true`, reverts the query to its previous state before cancellation.
- Defaults to `true`

## Utils

### `matchQuery`
Expand Down
1 change: 1 addition & 0 deletions docs/reference/QueryClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ await queryClient.cancelQueries({ queryKey: ['posts'], exact: true })
**Options**

- `filters?: QueryFilters`: [Query Filters](../../framework/react/guides/filters.md#query-filters)
- `cancelOptions?: CancelOptions`: [Cancel Options](../../framework/react/guides/filters.md#cancel-options)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `cancelOptions?: CancelOptions`: [Cancel Options](../../framework/react/guides/filters.md#cancel-options)
- `cancelOptions?: CancelOptions`: [Cancel Options](../../framework/react/guides/query-cancellation#XXX)

I think this would be a better place for CancelOptions. because CancelOptions is not about filters

Copy link
Contributor Author

@Sc4ramouche Sc4ramouche Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, moved it to query-cancellation guide.


**Returns**

Expand Down
Loading