You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/composables/useMutation.md
-38Lines changed: 0 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,6 @@ const {
24
24
loading,
25
25
mutate,
26
26
onDone,
27
-
onOptimistic,
28
27
} =useMutation(CREATE_POST)
29
28
30
29
asyncfunction submit() {
@@ -40,10 +39,6 @@ async function submit() {
40
39
onDone((payload) => {
41
40
console.log('Created post:', payload)
42
41
})
43
-
44
-
onOptimistic((payload) => {
45
-
console.log('Optimistic create:', payload)
46
-
})
47
42
```
48
43
49
44
## API
@@ -57,7 +52,6 @@ const {
57
52
called,
58
53
onDone,
59
54
onError,
60
-
onOptimistic,
61
55
reset,
62
56
} =useMutation(document, options)
63
57
```
@@ -94,25 +88,6 @@ const {
94
88
context.client.clearStore()
95
89
})
96
90
```
97
-
-**`onOptimistic((optimisticData, context) => {})`** – Fires when an `optimisticResponse` is provided for the mutation (either via base `options` or per‑call `mutateOptions`). Use this to react immediately to optimistic UI updates before the real network response arrives. The `context` contains the active Apollo client.
0 commit comments