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.
Your GraphQL server uses a schema to describe the shape of your available data. This schema defines a hierarchy of types with fields that are populated from your back-end data stores. The schema also specifies exactly which queries and mutations are available for clients to execute.
Protocol Buffers (Protobuf) is a free and open-source cross-platform data format used to serialize structured data. It is useful in developing programs to communicate with each other over a network or for storing data.
Your GraphQL server uses a schema to describe the shape of your data graph. This schema defines a hierarchy of types with fields that are populated from your back-end data stores. The schema also specifies exactly which queries and mutations are available for clients to execute against your data graph.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With