protoc-gen-twirpql
protoc-gen-twirpql copied to clipboard
support deprecation
Do you plan to support field metadata such as isDeprecated/deprecationReason?
@tmc yes, I plan on pushing deprecated fields to master
sometime tomorrow :)
But how would deprecationReason
be translated from protocol buffers? I don't think the protobuf spec supports deprecation reason right? Protoc-gen-go basically just puts do not use
as the reason.
The two options that come to mind are parsing a comment or introducing a protobuf extension to allow supplying structured metadata.
@tmc I already have a few extensions here which I haven't written documentation for yet.
I think we can add a free-form directive option. Such as:
message X {
string y = 1 {
option (twirpql.options.field) = {
directives = ["@deprecated(reason: whatever)", "@key"]
}
};
}
TwirpQL can still support the original deprecated option as well, but it would prioritize the custom inputs