react-query-auth icon indicating copy to clipboard operation
react-query-auth copied to clipboard

set query-retries

Open zouterover opened this issue 4 years ago • 0 comments

My general queryClientConfig for react-query is more or less the default one:

queryClientConfig: {
        defaultOptions: {
            queries: {
                retry: 2,
                refetchOnMount: "always",
                refetchOnWindowFocus: "always",
                refetchOnReconnect: "always",
                cacheTime: 1000*30,
                refetchInterval: false,
                refetchIntervalInBackground: false,
                suspense: false,
                staleTime: 1000 * 30,
            },
            mutations: {
                retry: 2,
            },
        }
    },

When I login with wrong login-details I get a 401, however I get three 401's (mutations are retried twice). When I reconfigure and set retry to 0 it indeed works as I want.

You can also set retry config per request: https://react-query.tanstack.com/guides/query-retries

So I would like to set number of retries only for login, but how would I do that using react-query-auth?

zouterover avatar Nov 04 '21 11:11 zouterover