Is it possible use react-query with grpc-web? #978
Replies: 3 comments 2 replies
-
This is a very complicated example, BUT: https://github.com/harmony-development/staccato/tree/edaf378adea16bd97ffc207e23041e91b87239fa (it was rewritten in vue later on, so that's why I linked that specific commit) |
Beta Was this translation helpful? Give feedback.
-
This isn't exactly what you asked for, but although it is possible to use react-query with grpcweb, after having some problems with TypeScript support, the non-idiomaticness and verbosity of constructing queries in multiple statements, and the bundle overhead of including I used grpc-gateway to expose the gRPC service as a REST API instead, which naturally works great with react-query. This automatically gives you all the query functions for your REST endpoints (simple functions calling the The extra work this requires is that you annotate your proto with the (standard) gRPC Transcoding annotations, and your service needs to expose a gateway for this (but then again, it also needs to expose a gateway for grpcweb) |
Beta Was this translation helpful? Give feedback.
-
Hey everyone! it's possible! Check out Connect-Query which is fully compatible with the gRPC-web Protocol as well as the Connect Protocol (which, is a better gRPC-web). |
Beta Was this translation helpful? Give feedback.
-
Is it possible use react-query with grpc-web?
Some examples, ideas?
Beta Was this translation helpful? Give feedback.
All reactions