简体   繁体   中英

Is there a way to generate a GraphQL schema from a protobuf?

I have a rather large/complex protobuf definition of an API, and I wonder if there's a convenient tool to automatically generate a textual GraphQL schema and its (nested) types from a subset of this protobuf?

I'm using Node.js normally, but I'm open for other languages to generate the schema.

If you're willing to use GoLang, there's a protobuf to GraphQL converter at

https://github.com/opsee/protobuf

Current gadgets graphql

The graphql gadget will generate a graphql schema for protobuf messages for use with the go-graphql package. It defines extensions for use in files, messages, and fields. See examples for usage -- the files generated by the plugin are flavortown.pb.go and flavortownpb_test.go.

Rejoiner will create a uniform GraphQL schema from protobuf sources (such as gRPC microservices).

http://rejoiner.io/

https://github.com/google/rejoiner

该项目从 protos 生成 graphql 模式: https : //github.com/tmc/protoc-gen-graphql

GraphQL Mesh support gRPC and Protobufs together with many other protocols.

Here you can find docs and examples

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM