{"repo":"ysugimoto/grpc-graphql-gateway","free":true,"listed":false,"github":"https://github.com/ysugimoto/grpc-graphql-gateway","clone":"git clone https://github.com/ysugimoto/grpc-graphql-gateway.git","description":"A protoc plugin that generates graphql execution code from Protocol Buffers.","language":"Go","stars":426,"topics":["grpc","golang","graphql","protocol-buffers"],"license":"MIT","category":"networking-infra","readme_excerpt":"grpc-graphql-gateway grpc-graphql-gateway is a protoc plugin that generates graphql execution code from Protocol Buffers. Motivation On API development, frequently we choose some IDL, in order to manage API definitions from a file. Considering two of IDL -- GraphQL and Protocol Buffers (for gRPC) -- these have positive point respectively: - GraphQL -- Can put together multiple resources getting into one HTTP request, appropriate for BFF - gRPC -- Easy syntax in Protocol Buffers, and easy to implement API server using HTTP/2 But sometimes it's hard to maintain both GraphQL and Protocol Buffers, so we created this plugin in order to generate GraphQL Schema from Protocol Buffers. This project much refers to grpc-gateway how to generate a file, provide a plugin. many thanks! Installation Get plugin binary Get protoc-gen-graphql binary from releases page and set $PATH to be executable. Or, simply get the latest one: Then the binary will place in $GOBIN . Get protobuf file Get include/graphql.proto from this repository and put it into your project under the protobuf files. Usage Please replace [your/project] section to your appropriate project. Write Protocol Buffers Declare gRPC service with protobuf using grpc-graphql-gateway options. This example has two RPCs that names SayHello and SayGoodbye : Compile to Go code Compile protobuf file with the plugin: Then you can see greeter/greeter.pb.go and greeter/greeter.graphql.go . Implement service For example, gRPC service will be: The","default_branch":null,"files":null,"tree":[],"storefront":"/r/ysugimoto","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ysugimoto/grpc-graphql-gateway/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}