Get custom resolvers for each GRPC server to only be called when data is needed. Add Custom resolver per fields in
gqlgen.yml
/graph/schema.resolver
You'll need to install Go Install grpc
brew install protobuf brew install protoc-gen-go brew install protoc-gen-go-grpc
make dep
make proto
We are using 3 grpc servers for our graphql
- launch on an other terminal a grpc-server as inside the example
make run
query servers {
returnTime {
server_1
server_3
}
}
server_2 should not be called, check Gin log or have any error from server_2
[GIN] 2022/08/02 - 09:30:39 | 200 | 2.68225ms | ::1 | POST "/query"
If you don't call that field (that have it's own custom resolver), the resolver itself never get called