I want to use gRPC service to communicate between my microservices. but when getting a response from Grpc service, before return a method, I want to do some modification and functionality.
sample project: https://github.com/nestjs/nest/tree/master/sample/04-grpc
like this:
@Get(':id')
getById(@Param('id') id: string): Observable<Hero> {
const res: Observable<Hero> = this.heroService.findOne({ id: +id });
console.log(res); res.name = res.name + 'modify string';
return res;
}
but show below message in console.log instead of the original response.
Observable { _isScalar: false, _subscribe: [Function] }