I think this question is more suited for gRPC, protobuf doesn't have 
standards about RPC endpoints.

On Friday, March 18, 2022 at 3:23:35 PM UTC-7 tyty wrote:

> I have a resource called Resturants. There are multiple fields and a few i 
> want to allow people to query specifically for (Rating and Location). 
>
> Is it better to create multiple RPC endpoints like:
>
> ```
> //all resturants
> QueryReseturants(QueryResturantsRequest) returns (QueryResturantsResponse)
>
> // all resturants with a specific rating
> QueryResturantsByRating(QueryResturantsByRatingRequest) returns 
> (QueryResturantsByRatingResponse)
>
> // all resturants with a specific locatoin
> QueryResturantsByLocation(QueryResturantsByLocationRequest) returns 
> (QueryResturantsByLocationResponse)
> ```
>
> OR is it better to have one query, with the specifics as fields:
>
> ```
> //all resturants
> QueryReseturants(QueryResturantsRequest) returns (QueryResturantsResponse)
> ```
> where QueryResturantsRequest contains a Rating and Location field. 
> Specifying neither will return all. or you can specify one or both of the 
> fields to narrow down the resturants returned.
>
> Either way works for our use case, but I'm mainly curious if this breaks 
> protobuf standards or something like that.
>
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/82cc7d86-446f-4308-bea3-9f8dc58f4e30n%40googlegroups.com.

Reply via email to