João Bezerra
Explore posts from serverserror route always getting 500 from trpc error? (next13/approuter)
I'm running into the same problem. Regardless of the code I pass to the constructor of
TRPCError
when throwing I still get INTERNAL_SERVER_ERROR
code on the client. Can anyone help?6 replies
Transform server response on the client before caching
Of course, it would be better if the frontend received the data in the best shape for it, but sometimes that is not possible. Just because trpc's tanstack query integration seemingly does not allow for overriding the queryFn this does not mean that transforming data on the frontend is necessarily an anti-pattern.
12 replies
Transform server response on the client before caching
I would think the problem is precisely the other way around. This is only a problem because (apparently) trpc does not allow for overriding the queryFn function. It should though as this is a very common thing to do. I'm actually surprised that it's not possible.
12 replies
Transform server response on the client before caching
I've been able to do it by manually calling the trpc procedures inside the queryFn with the vanilla client, but I was wondering if this was possible with the tanstack query integration.
12 replies
Transform server response on the client before caching
Not sure why you think this is an anti-pattern: https://tkdodo.eu/blog/react-query-data-transformations#:~:text=This%20is%20my,you%20expect%20it.
12 replies