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

CancelOptions.md

16 lines783 Bytes

1---
2id: CancelOptions
3title: CancelOptions
4---
5​
6Defined in: [packages/query-core/src/types.ts:2395](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L2395)
7​
8Options for cancelling an in-flight fetch, e.g. via `query.cancel()`.
9They are carried on the [CancelledError](../classes/CancelledError.md) that the cancelled fetch rejects with.
10​
11## Properties
12​
13| Property | Type | Description |
14| ------ | ------ | ------ |
15| <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. |
16| <a id="property-silent"></a> `silent?` | `boolean` | If `true`, the cancellation error isn't surfaced, e.g. because another fetch replaces the cancelled one. |