Skip to content

rmsrob/gql-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Gin gql server with GRPC custom resolvers

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors