mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import {QueryClient} from '@tanstack/react-query'
2
3export const queryClient = new QueryClient({
4 defaultOptions: {
5 queries: {
6 // NOTE
7 // refetchOnWindowFocus breaks some UIs (like feeds)
8 // so we NEVER want to enable this
9 // -prf
10 refetchOnWindowFocus: false,
11 // Structural sharing between responses makes it impossible to rely on
12 // "first seen" timestamps on objects to determine if they're fresh.
13 // Disable this optimization so that we can rely on "first seen" timestamps.
14 structuralSharing: false,
15 // We don't want to retry queries by default, because in most cases we
16 // want to fail early and show a response to the user. There are
17 // exceptions, and those can be made on a per-query basis. For others, we
18 // should give users controls to retry.
19 retry: false,
20 },
21 },
22})