update readme

This commit is contained in:
Robert Soriano
2022-05-19 01:37:45 -07:00
parent 4f2f88bea2
commit 38fb3edf22
2 changed files with 10 additions and 11 deletions

View File

@@ -64,7 +64,7 @@ const client = useClient() // auto-imported
const users = await client.query('getUsers')
const addUser = async () => {
const mutate = await client.mutation('createUser', {
const newUser = await client.mutation('createUser', {
name: 'wagmi'
})
}

View File

@@ -1,18 +1,17 @@
<script setup lang="ts">
const { data, error } = await useAsyncQuery(['getUser', { username: 'jcena' }], {
const { data, pending, error } = await useAsyncQuery(['getUser', { username: 'jcena' }], {
lazy: true,
})
const client = useClient()
</script>
<template>
<div>
<div v-if="data">
{{ JSON.stringify(data, null, 2) }}
<div v-if="pending">
Loading...
</div>
<div v-else-if="error">
asdx {{ JSON.stringify(error, null, 2) }}
Error: {{ JSON.stringify(error, null, 2) }}
</div>
<div v-else>
User {{ JSON.stringify(data, null, 2) }}
</div>
</template>