Rob BossR
tRPC3y ago
5 replies
Rob Boss

Need help

import {initTRPC} from '@trpc/server';
import * as trpcNext from '@trpc/server/adapters/next';
import {z} from 'zod';
const t=initTRPC.create();
const appRouter=t.router({greetings:t.procedure.input(z.object({name:z.string()}))})
.query(({input})=>{return {text:`hello ${input?.name ??'world'}`}});
export type AppRouter=typeof appRouter;
export default trpcNext.createNextApiHandler({router:appRouter,createContext:()=>({})})
why does t.query is not a function?
image.png
Was this page helpful?