Varich
Varich3mo ago

automatically add current path to the useQuery

Is there a way and how to add the current url(path) when call useQuery or useMutation, so that the current path is also being sent to the backend everytime. I think modify TRPCReactProvider might be useful, but that seem to be only evaluate once and not changing according to the page. My use case is that I'm doing /org/[orgname] and I want the orgname to be send to the backend everytime.
1 Reply
wleistra
wleistra3mo ago
Have you considered adding it to the client (http (batch) link) on the frontend and sending it in the header, so at the backend you can grab the orgname from there?

Did you find this page helpful?