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

Function defaultQueryFn

examples/react/default-query-function/src/index.tsx:19–24  ·  view source on GitHub ↗
({ queryKey }: { queryKey: QueryKey })

Source from the content-addressed store, hash-verified

17
18// Define a default query function that will receive the query key
19const defaultQueryFn = async ({ queryKey }: { queryKey: QueryKey }) => {
20 const response = await fetch(
21 `https://jsonplaceholder.typicode.com${queryKey[0]}`,
22 )
23 return await response.json()
24}
25
26// provide the default query function to your app via the query client
27const queryClient = new QueryClient({

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected