import { QueryClient } from '@tanstack/react-query';

const globalQueryClient = new QueryClient({
  defaultOptions: {
    queries: {
      // 사용자에게 에러상태를 즉시 보여주기 위해 retry false로 지정
      retry: false,
      refetchOnWindowFocus: true,
      throwOnError: true,
      // suspense: true,
      networkMode: 'always',
      
    },
    mutations: {
      throwOnError: true,
      networkMode: 'always',
    },
  },
});

export const getGlobalQueryClient = (): QueryClient => globalQueryClient;
