diff --git a/playground/pages/cookie.vue b/playground/pages/cookie.vue
deleted file mode 100644
index 13a39dc..0000000
--- a/playground/pages/cookie.vue
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
Counter: {{ counter || '-' }}
-
-
-
-
-
diff --git a/playground/pages/index.vue b/playground/pages/index.vue
index 4b47983..1dab210 100644
--- a/playground/pages/index.vue
+++ b/playground/pages/index.vue
@@ -25,11 +25,8 @@ const addTodo = async () => {
console.log(e)
}
}
-// console.log($client)
-const { data: todos, pending, error } = await $client.todo.getTodo.query(2, {
- // immediate: false,
- pick: ['completed'],
-})
+
+const { data: todos, pending, error, refresh } = await $client.getTodos.query()
@@ -40,26 +37,20 @@ const { data: todos, pending, error } = await $client.todo.getTodo.query(2, {
Error: {{ error.data.code }}
-
-
-
-
-
- {{ JSON.stringify(todos) }}
diff --git a/playground/pages/todo/[id].vue b/playground/pages/todo/[id].vue
index 6694229..5c251cc 100644
--- a/playground/pages/todo/[id].vue
+++ b/playground/pages/todo/[id].vue
@@ -1,6 +1,7 @@
@@ -11,8 +12,8 @@ const { data: todo, pending, error } = await useAsyncQuery(['getTodo', Number(ro
{{ error.data.code }}
- ID: {{ todo.id }}
- Title: {{ todo.title }}
- Completed: {{ todo.completed }}
+ ID: {{ todo?.id }}
+ Title: {{ todo?.title }}
+ Completed: {{ todo?.completed }}
diff --git a/playground/plugins/trpc-client.ts b/playground/plugins/trpc-client.ts
index da81407..550d84f 100644
--- a/playground/plugins/trpc-client.ts
+++ b/playground/plugins/trpc-client.ts
@@ -1,8 +1,9 @@
import { httpBatchLink } from '@trpc/client'
import { createTRPCNuxtProxyClient } from 'trpc-nuxt/client'
+import type { AppRouter } from '~~/server/trpc'
export default defineNuxtPlugin(() => {
- const client = createTRPCNuxtProxyClient({
+ const client = createTRPCNuxtProxyClient({
links: [
httpBatchLink({
url: 'http://localhost:3000/trpc',