supermemory/apps/browser-extension/utils/query-client.ts
2025-09-18 20:30:04 -07:00

24 lines
589 B
TypeScript

/**
* React Query configuration for supermemory browser extension
*/
import { QueryClient } from "@tanstack/react-query";
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 5 * 60 * 1000, // 5 minutes
gcTime: 10 * 60 * 1000, // 10 minutes (previously cacheTime)
retry: (failureCount, error) => {
// Don't retry on authentication errors
if (error?.constructor?.name === "AuthenticationError") {
return false;
}
return failureCount < 3;
},
refetchOnWindowFocus: false,
},
mutations: {
retry: 1,
},
},
});