hsubra89
hsubra89
TtRPC
Created by hsubra89 on 8/31/2023 in #❓-help
Using HTTP:POST for `query`?
Hmm, good point. However, caching API responses doesn’t seem like a standard use case. Especially if it’s behind auth as well. I was also under the impression that as long as cache-control headers are present, POST requests will be cached as well ( by CDNs and the browser )
10 replies
TtRPC
Created by hsubra89 on 8/31/2023 in #❓-help
Using HTTP:POST for `query`?
Rather than allow customising the underlying verb, using POST for everything would simplify everyone's lives IMO. I don't really see why there's any need for the HTTP verb to change based on whether something is a query or mutation within the app. The transport is mostly abstracted from the user anyway.
10 replies
TtRPC
Created by hsubra89 on 8/31/2023 in #❓-help
Using HTTP:POST for `query`?
At the end of the day, they are both RPC calls and the input / output shouldn't matter. The only reason there is any difference between whether something is a mutation / query at all seems to be for cleaner integration with react-query.
10 replies
TtRPC
Created by hsubra89 on 8/31/2023 in #❓-help
Using HTTP:POST for `query`?
In order to unblock myself, i'm just using react-query to wrap the useMutation explicitly which i've extracted into an abstract function. However, not having to deal with this issue at-all would be ideal.
10 replies