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

InvalidateOptions.md

19 lines949 Bytes

1---
2id: InvalidateOptions
3title: InvalidateOptions
4---
5​
6Defined in: [packages/query-core/src/types.ts:917](https://github.com/TanStack/query/blob/main/packages/query-core/src/types.ts#L917)
7​
8Options of `queryClient.invalidateQueries`, applied to the refetch that follows the invalidation.
9​
10## Extends
11​
12- [`RefetchOptions`](RefetchOptions.md)
13​
14## Properties
15​
16| Property | Type | Default value | Description |
17| ------ | ------ | ------ | ------ |
18| <a id="property-cancelrefetch"></a> `cancelRefetch?` | `boolean` | `true` | If set to `true`, a currently running request will be cancelled before a new request is made If set to `false`, no refetch will be made if there is already a request running. |
19| <a id="property-throwonerror"></a> `throwOnError?` | `boolean` | `false` | If set to `true`, the method throws if any of the underlying query refetch tasks fail. If set to `false`, failed refetches are swallowed and not surfaced to the caller. |