Files
upstream-tanstack-query/docs/framework/vue/guides/query-retries.md
upstream-mirror 3a013ccdfe
Some checks failed
autofix.ci / autofix (push) Failing after 4s
Release / Release (push) Has been skipped
GitHub Actions Security Analysis / Run zizmor (push) Failing after 2s
snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
2026-09-16 01:13:08 +05:00

40 lines
799 B
Markdown

---
id: query-retries
title: Query Retries
ref: docs/framework/react/guides/query-retries.md
replace: { 'Provider': 'Plugin' }
---
[//]: # 'Example'
```tsx
import { useQuery } from '@tanstack/vue-query'
// Make a specific query retry a certain number of times
const result = useQuery({
queryKey: ['todos', 1],
queryFn: fetchTodoListPage,
retry: 10, // Will retry failed requests 10 times before displaying an error
})
```
[//]: # 'Example'
[//]: # 'Example2'
```ts
import { VueQueryPlugin } from '@tanstack/vue-query'
const vueQueryPluginOptions = {
queryClientConfig: {
defaultOptions: {
queries: {
retryDelay: (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 30000),
},
},
},
}
app.use(VueQueryPlugin, vueQueryPluginOptions)
```
[//]: # 'Example2'