Skip to content

Commit 941fadb

Browse files
committed
feat(queryClient): update docs
1 parent 2b47fdc commit 941fadb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

docs/src/pages/reference/QueryClient.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ await queryClient.invalidateQueries('posts', {
276276
exact,
277277
refetchActive: true,
278278
refetchInactive: false
279-
}, { throwOnError })
279+
}, { throwOnError, cancelRefetch })
280280
```
281281

282282
**Options**
@@ -292,9 +292,11 @@ await queryClient.invalidateQueries('posts', {
292292
- `refetchPage: (page: TData, index: number, allPages: TData[]) => boolean`
293293
- Only for [Infinite Queries](../guides/infinite-queries#refetchpage)
294294
- Use this function to specify which pages should be refetched
295-
- `refetchOptions?: RefetchOptions`:
295+
- `options?: InvalidateOptions`:
296296
- `throwOnError?: boolean`
297297
- When set to `true`, this method will throw if any of the query refetch tasks fail.
298+
- cancelRefetch?: boolean
299+
- When set to `true`, then the current request will be cancelled before a new request is made
298300

299301
## `queryClient.refetchQueries`
300302

@@ -323,9 +325,11 @@ await queryClient.refetchQueries(['posts', 1], { active: true, exact: true })
323325
- `refetchPage: (page: TData, index: number, allPages: TData[]) => boolean`
324326
- Only for [Infinite Queries](../guides/infinite-queries#refetchpage)
325327
- Use this function to specify which pages should be refetched
326-
- `refetchOptions?: RefetchOptions`:
328+
- `options?: RefetchOptions`:
327329
- `throwOnError?: boolean`
328330
- When set to `true`, this method will throw if any of the query refetch tasks fail.
331+
- cancelRefetch?: boolean
332+
- When set to `true`, then the current request will be cancelled before a new request is made
329333

330334
**Returns**
331335

@@ -389,9 +393,11 @@ queryClient.resetQueries(queryKey, { exact: true })
389393
- `refetchPage: (page: TData, index: number, allPages: TData[]) => boolean`
390394
- Only for [Infinite Queries](../guides/infinite-queries#refetchpage)
391395
- Use this function to specify which pages should be refetched
392-
- `resetOptions?: ResetOptions`:
396+
- `options?: ResetOptions`:
393397
- `throwOnError?: boolean`
394398
- When set to `true`, this method will throw if any of the query refetch tasks fail.
399+
- cancelRefetch?: boolean
400+
- When set to `true`, then the current request will be cancelled before a new request is made
395401

396402
**Returns**
397403

0 commit comments

Comments
 (0)