immediately execute mutations

This commit is contained in:
Robert Soriano
2022-10-30 01:52:20 -07:00
parent 025ce7e028
commit b45c613ce7
3 changed files with 4 additions and 28 deletions

View File

@@ -11,14 +11,13 @@ const addTodo = async () => {
const title = Math.random().toString(36).slice(2, 7)
try {
const result = await $client.todo.addTodo.mutate({
const x = await $client.todo.addTodo.mutate({
id: Date.now(),
userId: 69,
title,
completed: false,
})
await result.execute()
console.log('Todo: ', result.data.value)
console.log(x.data.value)
}
catch (e) {
console.log(e)