Files
big-agi/src/common/app.queryclient.ts
T
2025-10-15 12:57:33 -07:00

26 lines
706 B
TypeScript

import { QueryClient } from '@tanstack/react-query';
let queryClient: QueryClient | null = null;
export function reactQueryClientSingleton(): QueryClient {
if (!queryClient) {
queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: false,
// call functions even when the network is disconnected; this makes 127.0.0.1 work, while probably not causing other issues
networkMode: 'always',
refetchOnReconnect: false, // implied by networkMode: always
refetchOnWindowFocus: false,
},
mutations: {
retry: false,
networkMode: 'always',
},
},
});
}
return queryClient;
}