- {{ error }}
+ {{ data }}
+
diff --git a/playground/nuxt.config.ts b/playground/nuxt.config.ts
index 33734ba..33d6bbf 100644
--- a/playground/nuxt.config.ts
+++ b/playground/nuxt.config.ts
@@ -4,6 +4,9 @@ import Module from '..'
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
modules: [Module],
+ runtimeConfig: {
+ baseURL: 'http://localhost:3000',
+ },
typescript: {
strict: true,
},
diff --git a/playground/plugins/trpc.ts b/playground/plugins/trpc.ts
new file mode 100644
index 0000000..6c1edb8
--- /dev/null
+++ b/playground/plugins/trpc.ts
@@ -0,0 +1,17 @@
+import { defineNuxtPlugin } from '#app'
+
+export default defineNuxtPlugin((nuxtApp) => {
+ // if (process.server) {
+ // nuxtApp.hooks.hook('app:rendered', () => {
+ // nuxtApp.ssrContext['']
+ // })
+ // }
+
+ // if (process.client) {
+ // nuxtApp.hooks.hook('app:created', () => {
+ // console.log('app:created')
+ // })
+ // }
+ if (nuxtApp.ssrContext)
+ console.log('hello', nuxtApp.ssrContext)
+})
diff --git a/playground/server/trpc/index.ts b/playground/server/trpc/index.ts
index e3e6e9f..a59b23b 100644
--- a/playground/server/trpc/index.ts
+++ b/playground/server/trpc/index.ts
@@ -1,21 +1,45 @@
// ~/server/trpc/index.ts
import { z } from 'zod'
import * as trpc from '@trpc/server'
+import type { inferAsyncReturnType } from '@trpc/server'
const fakeUsers = [
- { id: 1, username: 'jcena', name: 'John Cena' },
- { id: 2, username: 'dbatista', name: 'Dave Batista' },
- { id: 3, username: 'jbiden', name: 'Joe Biden' },
+ { id: 1, username: 'jcena' },
+ { id: 2, username: 'dbatista' },
+ { id: 3, username: 'jbiden' },
]
export const router = trpc
- .router()
+ .router