Skip to content

Commit f6aaa85

Browse files
authored
docs: fixes fetch example which throws error (TanStack#1742)
1 parent f65623f commit f6aaa85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/src/pages/guides/query-functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ While most utilities like `axios` or `graphql-request` automatically throw error
3636

3737
```js
3838
useQuery(['todos', todoId], async () => {
39-
const { ok, json } = await fetch('/todos/' + todoId)
40-
if (!ok) {
39+
const response = await fetch('/todos/' + todoId)
40+
if (!response.ok) {
4141
throw new Error('Network response was not ok')
4242
}
43-
return json()
43+
return response.json()
4444
})
4545
```
4646

0 commit comments

Comments
 (0)