rustclan
return type of a query endpoint
Sorry, I just saw these messages.
At the moment I mainly use refetch to update the response once something has been updated/deleted. I should probably just return the updated document in the response to the mutation, or in the case of a delete just remove it from the original data list. Would be more efficient for sure.
8 replies
TRPC ratelimiting endpoints
Hmm, yes okay. I see what you are saying. This depends on vercel runs nextjs api endpoints, im not entirely sure. For now, this is working just fine. But I should look into this just encase. Thank you very much for the help 🙂
20 replies
TRPC ratelimiting endpoints
Hi, thank you for the response. But I'm not sure I follow. Since this is hosted on serverless infrastructure (vercel), I don't think this is possible to use a in memory cache to stop this from happening? I may be misunderstanding your solution though.
20 replies
trpc auto refreshes page when I lose focus
Hi. Thank you 🙂
I have found
refetchOnWindowFocus
which is what I am looking for. Here is my fix for any future people.
https://tanstack.com/query/v4/docs/react/guides/window-focus-refetching5 replies
trpc query running twice
Technically, i could make it so the queries only run once in dev. But, this feature is enabled by default for a reason. Also, doing that is just a band aid fix. What if the user refreshes the page twice? Then my app breaks for a few second and the user gets greeted with a error page. Even though they have already recieved the data from the first request.
10 replies