Skip to content

Run-time type information #245

@rapropos

Description

@rapropos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions