export const queryClient = new QueryClient({
defaultOptions: {
queries: {
// staleTime defines how long the data is considered fresh.
// During this time, no background refetch will occur, and the cached data will be used.
retry: 2,
retryDelay: 5000,
staleTime: Infinity, // Data will never become stale
},
mutations: {
// mutation settings can also be defined here.
// mutations generally do not have a staleTime as they are one-time operations,
// but you can add retry or other settings if needed.
retryDelay: 5000,
retry: 2, // Retries failed mutations up to 3 times
},
},
});
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
// staleTime defines how long the data is considered fresh.
// During this time, no background refetch will occur, and the cached data will be used.
retry: 2,
retryDelay: 5000,
staleTime: Infinity, // Data will never become stale
},
mutations: {
// mutation settings can also be defined here.
// mutations generally do not have a staleTime as they are one-time operations,
// but you can add retry or other settings if needed.
retryDelay: 5000,
retry: 2, // Retries failed mutations up to 3 times
},
},
});