我有一个相当大/复杂的 API protobuf 定义,我想知道是否有一个方便的工具可以从这个 protobuf 的子集自动生成文本 GraphQL 模式及其(嵌套)类型?
我在正常使用 Node.js,但我愿意接受其他语言来生成架构。
最佳答案
如果你愿意使用 GoLang,这里有一个 protobuf 到 GraphQL 转换器
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.
关于javascript - 有没有办法从 protobuf 生成 GraphQL 模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44397956/