({ queryKey }: { queryKey: QueryKey })
| 5 | |
| 6 | // Define a default query function that will receive the query key |
| 7 | const defaultQueryFn = async ({ queryKey }: { queryKey: QueryKey }) => { |
| 8 | const response = await fetch( |
| 9 | `https://jsonplaceholder.typicode.com${queryKey[0]}`, |
| 10 | ) |
| 11 | if (!response.ok) throw new Error('Failed to fetch data') |
| 12 | return await response.json() |
| 13 | } |
| 14 | |
| 15 | createApp(App) |
| 16 | // provide the default query function to your app via the query client |
nothing calls this directly
no outgoing calls
no test coverage detected