Open moles1 opened 3 years ago
Additionally, the NestJS gRPC documentation now describes a third grpc.ServerUnaryCall<any>
parameter to Controller methods (see https://docs.nestjs.com/microservices/grpc#grpc-metadata), although I'm unsure how often this is utilized in practice and whether it warrants inclusion in the generated types.
@moles1 hey, sorry for the late follow up here, but I agree with both of your observations; if you could submit a PR that changes both, that'd be great! Thanks!
The
addGrpcMetadata
flag for NestJS mode is a really nice feature, but it seems like the behaviour should be different wrt the generatedController
vsClient
interfaces. i.e. imo it would be more useful as an optional parameter to the Client methods, so that the metadata arg doesn't need to be explicitly passed in that context. It still makes perfect sense as a required parameter to the Controller methods.Obviously, one could easily ignore the
addGrpcMetadata
flag and simply useaddNestjsRestParameter
instead, then:grpc.Metadata
param to Controller methods (along with anything else) as desiredgrpc.Metadata
argument to Client methods at the call site as desiredHowever, this could still be a nice QoL improvement :)