MCPcopy Create free account
hub / github.com/TanStack/query / makeQueryClient

Function makeQueryClient

integrations/react-next-15/app/make-query-client.ts:21–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19})
20
21export function makeQueryClient() {
22 return new QueryClient({
23 defaultOptions: {
24 hydrate: {
25 /**
26 * Called when the query is rebuilt from a prefetched
27 * promise, before the query data is put into the cache.
28 */
29 deserializeData: (data) => {
30 return tson.deserialize(data)
31 },
32 },
33 queries: {
34 staleTime: 60 * 1000,
35 },
36 dehydrate: {
37 serializeData: (data) => {
38 return tson.serialize(data)
39 },
40 shouldDehydrateQuery: (query) => {
41 return (
42 defaultShouldDehydrateQuery(query) ||
43 query.state.status === 'pending'
44 )
45 },
46 shouldRedactErrors: (error) => {
47 // Next.js automatically redacts errors for us
48 return false
49 },
50 },
51 },
52 })
53}

Callers 2

getQueryClientFunction · 0.90
HomeFunction · 0.90

Calls 1

Tested by

no test coverage detected