-
Notifications
You must be signed in to change notification settings - Fork 48
Run-time type information #245
Description
I am trying to use webrpc as a replacement for GraphQL, and have hit a roadblock in that I have some types that are otherwise indistinguishable over the wire, aside from the __typename field. I suppose I could add this sort of discriminator manually to the type definition, and feed it in the service, but this seems rather error-prone.
Would this be something that you might consider adopting upstream, or am I going to be totally on my own maintaining a fork if I go the route of hacking up the generators?
There doesn't seem to be a way to add override directives (or whatever you call the + go.field.type = foo sort of lines in RIDL) to a struct definition itself, but perhaps that is a larger can of worms. I was hoping that it could be enabled on a per-type basis with one of these directives, but I'm not sure if that is feasible.