Songkeys
Songkeys
TtRPC
Created by Songkeys on 8/19/2024 in #❓-help
Is it possible to request directly from user's browser rather than using a server proxy in trpc?
I have been using trpc in my project and it's been working really well. However, some requests need to be sent from the browser to the target API instead of our server. I am considering creating a React-Query API wrapper directly, but I'm concerned it might not align well with trpc usage. Is it feasible to implement something like this:
import { api } from "~/trpc-browser"
const res = api.something.useQuery()
import { api } from "~/trpc-browser"
const res = api.something.useQuery()
or
const res = api.something.useQuery({}, {
requestFromBrowser: true
})
const res = api.something.useQuery({}, {
requestFromBrowser: true
})
I hope I have clarified my points. Thank you.
2 replies
TtRPC
Created by Songkeys on 2/29/2024 in #❓-help
After upgrading to 11.0.0-next-beta.300, every request throws zod error
No description
35 replies