isFetching } = trpc.productDetail.useQuery({ id: "1234" }) if (isFetching || !data) return <div>Loading...</div> return ( <div> Product name: {data.name} </div> ) } Browser JS Node.js const getContext = () => ({ prisma }) const { router, procedure } = initTRPC.context<typeof getContext>().create() const productDetail = procedure .input(z.object({ id: z.string() })) .query(async ({ ctx: { prisma }, input: { id } }) => { const result = await prisma.product.findUnique({ where: { id } }) return { id: result.id, name: result.name, price: result.price, } }) export const appRouter = router({ productDetail, }) export type AppRouter = typeof appRouter Internet Inference Inference