({ queryKey })
| 12 | |
| 13 | // Define a default query function that will receive the query key |
| 14 | const defaultQueryFn: QueryFunction<unknown> = async ({ queryKey }) => { |
| 15 | const response = await fetch( |
| 16 | `https://jsonplaceholder.typicode.com${queryKey[0]}`, |
| 17 | { |
| 18 | method: 'GET', |
| 19 | }, |
| 20 | ) |
| 21 | return response.json() |
| 22 | } |
| 23 | |
| 24 | // provide the default query function to your app via the query client |
| 25 | const queryClient = new QueryClient({ |
nothing calls this directly
no outgoing calls
no test coverage detected