From 20bd90585a59e788b47a827e153a3cb62f90ddb6 Mon Sep 17 00:00:00 2001 From: Dnyaneshwar Ware Date: Wed, 1 Nov 2023 12:56:08 +0530 Subject: [PATCH] docs: add information about error while retry attempts (#6276) - I noticed this while I was trying to use useQuery and trying to capture the error property. I think this is something which can be added as extra information for those who will be using it for first time. --- docs/react/guides/query-retries.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/react/guides/query-retries.md b/docs/react/guides/query-retries.md index b6090d02de..9fab4984c9 100644 --- a/docs/react/guides/query-retries.md +++ b/docs/react/guides/query-retries.md @@ -29,6 +29,8 @@ const result = useQuery({ [//]: # 'Example' +> Info: Contents of the `error` property will be part of `failureReason` response property of `useQuery` until the last retry attempt. So in above example any error contents will be part of `failureReason` property for first 9 retry attempts (Overall 10 attempts) and finally they will be part of `error` after last attempt if error persists after all retry attempts. + ## Retry Delay By default, retries in TanStack Query do not happen immediately after a request fails. As is standard, a back-off delay is gradually applied to each retry attempt.