Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/src/pages/guides/query-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ While most utilities like `axios` or `graphql-request` automatically throw error

```js
useQuery(['todos', todoId], async () => {
const { ok, json } = await fetch('/todos/' + todoId)
if (!ok) {
const response = await fetch('/todos/' + todoId)
if (!response.ok) {
throw new Error('Network response was not ok')
}
return json()
return response.json()
})
```

Expand Down