Open schickling opened 6 years ago
We are considering something similar for gqlgen.
A few things I would love to see:
cake: Cake @grpc(method:"EatCake", server: "cheescake-shop")
Some more questions:
What should be the plugin/config "input"? Do we assume there's already a generated TS gRPC client or is it the responsibility to also generate one (including the resulting model type definitions) based on a .proto file?
At 99designs all of our clients are generated when the downstream apps merge, and are pushed to a shared repo, so this wouldn't be super useful and might be kinda tricky to do well?
It's a very common use-case to use GraphQL as a gateway (as opposing to a GraphQL monolith/service) in front of other services (e.g. gRPC, Thrift, ...). I'd like to explore the possible workflows of using
graphqlgen
to auto-generate/auto-scaffold resolvers mapping to gRPC services.My current idea would be to create a scaffolding plugin (see #84) which instead of scaffolding a resolver that throws an error, actually scaffolds a runnable resolver that calls out to the corresponding gRPC service.
The needed configuration/mapping could either be provided via some namespace in
graphqlgen.yml
or partially in the application schema via schema directives. Here's an idea how the config could look like in thegraphqlgen.yml
Related: https://github.com/99designs/gqlgen/issues/228
Open Questions
.proto
file?