tRPCttRPC
Powered by
PieterP
tRPC•3y ago•
2 replies
Pieter

How can I make a direct fetch on a router endpoint from TRPC in NextJS on client?

In the documentation you can use the vanilla TRPC client like this:

const bilbo = await client.getUser.query('id_bilbo');
const bilbo = await client.getUser.query('id_bilbo');


But with NextJS app is wrapped with the WithTRPC wrapper. where you can only use hooks. How can I make a direct call?
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How can you fetch data on a dynamic router with trpc?
josephbranchJjosephbranch / ❓-help
3y ago
How can i createCaller from a NextJs App Router if my server uses express tRPC adapter?
KylarKKylar / ❓-help
3y ago
PersistQueryClientProvider in tRPC NextJS pages router app
Answer OverflowAAnswer Overflow / ❓-help
3y ago
Can i fetch tRPC in different project
cocoCcoco / ❓-help
3y ago