Add service name in generated gRPC code
- Dominant language
- Dart
- Stars
- 572
- Forks
- 196
- Avg merge
- 1h 59m
- Merged PRs (30d)
- 2
Description
When doing a [gRPC health check](https://github.com/grpc/grpc/blob/master/src/proto/grpc/health/v1/health.proto), we can specify the service name to check. However, there's no way to extract that from the generated code on the client without creating a stub server, e.g.
```dart
doHealthCheck() {
final client = HealthClient(channel, options: defaultCallOptions);
final healthResponse = await client.check(
HealthCheckRequest()
..service = StubChessService().$name
..freeze());
}
class StubChessService extends ChessService {
...
}
```
It would be helpful to have a static serviceName on the generated client to avoid magic strings or creating stubs.
Contributor guide
Assessment
This issue has not been assessed yet.