Skip to content

Polymorphic input types #114

Closed
Closed
@luisobo

Description

@luisobo

We have an interface Customization and around 20 types implementing this interface. The number of subtypes of Customization will grow over time, we are even considering adding subtypes dinamically.

Each concrete type has it own set of attributes.

On the query side this is easy to represent. The problem is at the mutation side. We want to have a mutation method to add a customization to another object

addCustomizationToNode(nodeId: ID, customizationInput: CustomizationInput)

but this is not currently possible to express since Input Objects cannot have interfaces, we would rather not have one mutation field per subtype, specially since those can change dynamically, potentially.

Do you have any suggestions? Would make sense to have InputObjects take interfaces?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    👻 Needs ChampionRFC Needs a champion to progress (See CONTRIBUTING.md)💭 Strawman (RFC 0)RFC Stage 0 (See CONTRIBUTING.md)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions