Skip to content

Commit 141cc84

Browse files
authored
docs: fix wrong import (#120)
1 parent 727bf1d commit 141cc84

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/guides/mutations.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Here's an example of a mutation that adds a new todo to the server:
44

55
```vue
66
<script setup>
7-
import { useQuery } from "vue-query";
7+
import { useMutation } from "vue-query";
88
99
function useAddTodoMutation() {
1010
return useMutation((newTodo) => axios.post("/todos", newTodo));
@@ -47,7 +47,7 @@ It's sometimes the case that you need to clear the `error` or `data` of a mutati
4747

4848
```vue
4949
<script>
50-
import { useQuery } from "vue-query";
50+
import { useMutation } from "vue-query";
5151
5252
function useAddTodoMutation() {
5353
return useMutation((newTodo) => axios.post("/todos", newTodo));
@@ -111,10 +111,10 @@ function useAddTodoMutation() {
111111
}
112112
```
113113

114-
You might find that you want to **trigger additional callbacks** than the ones defined on `useMutation` when calling `mutate`.
115-
This can be used to trigger component-specific side effects.
116-
To do that, you can provide any of the same callback options to the `mutate` function after your mutation variable.
117-
Supported overrides include: `onSuccess`, `onError` and `onSettled`.
114+
You might find that you want to **trigger additional callbacks** than the ones defined on `useMutation` when calling `mutate`.
115+
This can be used to trigger component-specific side effects.
116+
To do that, you can provide any of the same callback options to the `mutate` function after your mutation variable.
117+
Supported overrides include: `onSuccess`, `onError` and `onSettled`.
118118
Please keep in mind that those additional callbacks won't run if your component unmounts **before** the mutation finishes.
119119

120120
```js

0 commit comments

Comments
 (0)