First Commit Test

This commit is contained in:
katja committed 2023-04-11 15:08:56 +02:00
commit 4079fade0a
24 files changed
+11503

No files matched your search

+24
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
}
}
})