We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c1bb1f commit 12e128bCopy full SHA for 12e128b
docs/src/pages/guides/query-functions.md
@@ -8,12 +8,13 @@ A query function can be literally any function that **returns a promise**. The p
8
All of the following are valid query function configurations:
9
10
```js
11
-useQuery(['todos', todoId], fetchTodoById)
+useQuery(['todos'], fetchAllTodos)
12
useQuery(['todos', todoId], () => fetchTodoById(todoId))
13
useQuery(['todos', todoId], async () => {
14
const data = await fetchTodoById(todoId)
15
return data
16
})
17
+useQuery(['todos', todoId], ({ queryKey }) => fetchTodoById(queryKey[1]))
18
```
19
20
## Handling and Throwing Errors
0 commit comments