Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 1015 Bytes

README.md

File metadata and controls

49 lines (36 loc) · 1015 Bytes

GQL - SERVER

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

Install

GO / GRPC

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

Launch

We are using 3 grpc servers for our graphql

  • launch on an other terminal a grpc-server as inside the example
  • make run

open http://localhost:8080/

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