Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion docs/src/pages/reference/useQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ const result = useQuery({
- The failure count for the query.
- Incremented every time the query fails.
- Reset to `0` when the query succeeds.
- `refetch: (options: { throwOnError: boolean }) => Promise<UseQueryResult>`
- `refetch: (options: { throwOnError: boolean, cancelRefetch: boolean }) => Promise<UseQueryResult>`
- A function to manually refetch the query.
- If the query errors, the error will only be logged. If you want an error to be thrown, pass the `throwOnError: true` option
- If `cancelRefetch` is `true`, then the current request will be cancelled before a new request is made
- `remove: () => void`
- A function to remove the query from the cache.
4 changes: 3 additions & 1 deletion src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ export interface ResultOptions {
throwOnError?: boolean
}

export interface RefetchOptions extends ResultOptions {}
export interface RefetchOptions extends ResultOptions {
cancelRefetch?: boolean;
}

export interface InvalidateQueryFilters extends QueryFilters {
refetchActive?: boolean
Expand Down