ysugimoto / grpc-graphql-gateway

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

support google's ptype on mutation output #47

Closed ysugimoto closed 3 years ago

ysugimoto commented 3 years ago

This PR supports Google's ptype on Mutation output. In many cases, mutation request does not need any response, for example,

protocolbuffers

service Example {
  rpc Create(CreateRequest) returns (google.protobuf.Empty) {
    option (graphql.schema) = {
      type: MUTATION,
      name: "create"
    };
  }
}

Graphql Schema

type Mutation {
  create(input: InputObject!) Google_type_Empty!
}

Its use case is put some data and does not need response data and then we can use google.protobuf.Empty for reducing response body.