How does routing work in tRPC especially when using merged routers?
I am having trouble understanding how tRPC lays out routes. Let's say I have the below
My assumption is that from the above example I have:
However when using Insomnia to query the endpoints as I familiarize myself with tRPC more I get 404s. Could someone explain this to me better?
I am running:
3 Replies
In Postman I had to use:
GET /trpc/user.getUsers
So in your case it would be:
GET /trpc/api.version
Also new to TRPC and unfamiliar with Insomnia, but I hope that helps.@Longhumans you sir are a fucking boss! Thank you I would never have figured that out. Makes some sense now with the way the client consumes:
trpc.api.version.query()
Thanks again!Happy it helped 🙂