Ahmad ShbeebA
tRPC2y ago
2 replies
Ahmad Shbeeb

trpc useQuery/useMutation not inferring return type of prisma query

Env: Node18 , npm
i'm using turborepo with the server as Honojs + hono-trpc adapter and the client as react vite

So i've already did the setup as said in the docs and everything is working perfectly everything returned from the trpc procedures is inferred except when i return a prisma query then the inferred type is "any" ??

Even though the procedure output is correct but the client is "any" only with prisma
i've already tried using superjson transformer still no luck
image.png
image.png
Solution
i solved it
so it was an error with the context which contains (prisma and telegram bot) not being inferred from the client so i had to type it manually now all returned prisma queries works as expected
image.png
image.png
Was this page helpful?