INNER CODE UNIT · Go
Register
ysugimoto/grpc-graphql-gateway · protoc-gen-graphql/template.go:432
func Register{{ .Name }}Graphql(mux *runtime.ServeMux) error {
return Register{{ .Name }}GraphqlHandler(mux, nil)
}
// Register package divided graphql handler "with" *grpc.ClientConn.
// this function accepts your defined grpc connection, so that we reuse that and never close connection inside.
// You need to close it maunally when application will terminate.
// Otherwise, you can specify automatic opening connection with ServiceOption directive:
//
// service {{ .Name }} {
// option (graphql.service) = {
// host: "host:port"
// insecure: true or false
// };
//
// ...with RPC definitions
// }
func Register{{ .Name }}GraphqlHandler(mux *runtime.ServeMux, conn *grpc.ClientConn) error {