From b58d662edc84fb9f018ea16c8f957e24c807a507 Mon Sep 17 00:00:00 2001 From: Robert Soriano Date: Mon, 31 Oct 2022 00:37:45 -0700 Subject: [PATCH] update docs --- docs/content/1.get-started/2.usage.md | 8 ++++---- playground/server/api/trpc/[trpc].ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/content/1.get-started/2.usage.md b/docs/content/1.get-started/2.usage.md index 1027cf2..8c269b2 100644 --- a/docs/content/1.get-started/2.usage.md +++ b/docs/content/1.get-started/2.usage.md @@ -35,7 +35,7 @@ Initialize your tRPC backend using the `initTRPC` function and create your first ::code-group ```ts [server/trpc/trpc.ts] -import { TRPCError, initTRPC } from '@trpc/server' +import { initTRPC } from '@trpc/server' // Avoid exporting the entire t-object since it's not very // descriptive and can be confusing to newcomers used to t @@ -49,7 +49,7 @@ export const publicProcedure = t.procedure ```ts [server/trpc/routers/index.ts] import { z } from 'zod' -import { publicProcedure, router } from '..' +import { publicProcedure, router } from '../trpc' export const appRouter = router({ hello: publicProcedure @@ -71,7 +71,7 @@ export type AppRouter = typeof appRouter ```ts [server/api/trpc/[trpc].ts] import { createNuxtApiHandler } from 'trpc-nuxt' -import { appRouter } from '../../trpc/routers' +import { appRouter } from '@/server/trpc/routers' // export API handler export default createNuxtApiHandler({ @@ -93,7 +93,7 @@ Create a set of strongly-typed composables using your API's type signature. ```ts [plugins/client.ts] import { httpBatchLink } from '@trpc/client' import { createTRPCNuxtProxyClient } from 'trpc-nuxt/client' -import type { AppRouter } from '~~/server/trpc/routers' +import type { AppRouter } from '@/server/trpc/routers' export default defineNuxtPlugin(() => { const client = createTRPCNuxtProxyClient({ diff --git a/playground/server/api/trpc/[trpc].ts b/playground/server/api/trpc/[trpc].ts index c8eb4d6..3e76c39 100644 --- a/playground/server/api/trpc/[trpc].ts +++ b/playground/server/api/trpc/[trpc].ts @@ -1,6 +1,6 @@ import { createNuxtApiHandler } from 'trpc-nuxt' -import { appRouter } from '../../trpc/routers' -import { createContext } from '~~/server/trpc/context' +import { appRouter } from '@/server/trpc/routers' +import { createContext } from '@/server/trpc/context' export default createNuxtApiHandler({ router: appRouter,