Khel
Khel3mo ago

Can I use tRPC with Tanstack Start while fetching or performing mutations from an external API?

Hello everyone! I really appreciate tRPC, particularly its type safety when making function calls between the client and server. In my current project, I'm utilizing external API endpoints for fetching data and making POST requests. Example:
const res = await axios.get<Artifact | undefined>(
`${GENERATION_SERVICE_FQDN}/artifact/${id}`,
);
const res = await axios.get<Artifact | undefined>(
`${GENERATION_SERVICE_FQDN}/artifact/${id}`,
);
I'm curious if integrating tRPC would be beneficial in this context. My primary goal is to leverage the type safety it offers for both inputs and outputs. Additionally, I'm using Tanstack Query in conjunction for prefetching logic.
1 Reply
Khel
KhelOP3mo ago
Our backend is developed in Python, and I am accessing it through an external API.

Did you find this page helpful?