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 users = await client.query('getUsers')
const addUser = async () => { const addUser = async () => {
const mutate = await client.mutation('createUser', { const newUser = await client.mutation('createUser', {
name: 'wagmi' name: 'wagmi'
}) })
} }

View File

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