First Commit Test

This commit is contained in:
2023-04-11 15:08:56 +02:00
commit 4079fade0a
24 changed files with 11503 additions and 0 deletions

24
plugins/trpcClient.ts Normal file
View File

@ -0,0 +1,24 @@
import { createTRPCNuxtClient, httpBatchLink } from 'trpc-nuxt/client'
import superjson from 'superjson'
import type { AppRouter } from '~/server/trpc/routers'
export default defineNuxtPlugin(() => {
/**
* createTRPCNuxtClient adds a `useQuery` composable
* built on top of `useAsyncData`.
*/
const client = createTRPCNuxtClient<AppRouter>({
transformer: superjson,
links: [
httpBatchLink({
url: '/api/trpc'
})
]
})
return {
provide: {
client
}
}
})