ysugimoto / grpc-graphql-gateway

A protoc plugin that generates graphql execution code from Protocol Buffers.
MIT License
382 stars 50 forks source link

handling message objects with package names and protoc-gen-go style `M` param #44

Open quinn opened 3 years ago

quinn commented 3 years ago

Hi, I'm reviewing the implementation and I don't think it would work for multiple services / endpoints. I can put in some time to add this functionality, but I would need to know a good starting point of how this might work. Right now the graphql handler expects to be in the same go package as the generated GRPC code, so for this to work this assumption would need to change, I think. Would love to know your thoughts on this, thank you!

quinn commented 3 years ago

a few more comments:

quinn commented 3 years ago

sorry, one more thing: specifying the host in the proto seems inflexible. ideally there would be a way to change the host after the code is generated, to allow for an image that works in dev, staging, and prod.

quinn commented 3 years ago

I understand the runtime code a bit better now, and it seems like multiple services is supported with the muxer, which is great! So, i'm working on some patches to make it work with protobuf's with namespaces:

service Something {
  rpc CreateThing(somepkg.RequestMessage) returns (somepkg.ResponseMessage) {
  ...

currently this breaks on the code formatter step in the generator.