Open History to see the last commit
1---
2id: query-retries
3title: Query Retries
4ref: docs/framework/react/guides/query-retries.md
5replace: { 'Provider': 'Plugin' }
6---
7β
8[//]: # 'Example'
9β
10```tsx
11import { useQuery } from '@tanstack/vue-query'
12β
13// Make a specific query retry a certain number of times
14const result = useQuery({
15 queryKey: ['todos', 1],
16 queryFn: fetchTodoListPage,
17 retry: 10, // Will retry failed requests 10 times before displaying an error
18})
19```
20β
21[//]: # 'Example'
22[//]: # 'Example2'
23β
24```ts
25import { VueQueryPlugin } from '@tanstack/vue-query'
26β
27const vueQueryPluginOptions = {
28 queryClientConfig: {
29 defaultOptions: {
30 queries: {
31 retryDelay: (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 30000),
32 },
33 },
34 },
35}
36app.use(VueQueryPlugin, vueQueryPluginOptions)
37```
38β
39[//]: # 'Example2'