João Bezerra
João Bezerra
Explore posts from servers
TtRPC
Created by jack on 10/24/2023 in #❓-help
error route always getting 500 from trpc error? (next13/approuter)
@jack Were you able to figure out a solution?
6 replies
TtRPC
Created by jack on 10/24/2023 in #❓-help
error 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
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
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
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
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
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
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
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
Transform server response on the client before caching
Also, using the select function wouldn't work as it doesn't transform the data before caching which is what I want.
12 replies
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
Transform server response on the client before caching
12 replies
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
Transform server response on the client before caching
Because I can't send the data from the server exactly the way the client wants it but I still want to transform the data before it gets put in the cache.
12 replies