Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

CancelOptions.md

18 lines856 Bytes

1---
2id: CancelOptions
3title: CancelOptions
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8Defined in: [packages/query-core/src/types.ts:2395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L2395)
9​
10Options for cancelling an in-flight fetch, e.g. via `query.cancel()`.
11They are carried on the [CancelledError](../classes/CancelledError.md) that the cancelled fetch rejects with.
12​
13## Properties
14​
15| Property | Type | Description |
16| ------ | ------ | ------ |
17| <a id="property-revert"></a> `revert?` | `boolean` | If `true`, the query goes back to the state it had before the fetch started, instead of getting the cancellation error. |
18| <a id="property-silent"></a> `silent?` | `boolean` | If `true`, the cancellation error isn't surfaced, e.g. because another fetch replaces the cancelled one. |