mirror of
https://github.com/langgenius/dify.git
synced 2026-07-21 18:58:35 +08:00
18 lines
454 B
TypeScript
18 lines
454 B
TypeScript
import type { QueryFunction } from '@tanstack/react-query'
|
|
import { QueryClient } from '@tanstack/react-query'
|
|
|
|
export const createTestQueryClient = (queryFn?: QueryFunction) =>
|
|
new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
retry: false,
|
|
gcTime: Number.POSITIVE_INFINITY,
|
|
staleTime: Number.POSITIVE_INFINITY,
|
|
...(queryFn && { queryFn }),
|
|
},
|
|
mutations: {
|
|
retry: false,
|
|
},
|
|
},
|
|
})
|