Skip to content

Union InputType? #721

Description

@yywing

I have three type.

class A(InputType):
    pass

class B(InputType):
    start_time = String()

class C(InputType):
    start_time = String()
    end_time = String()

So I hope that:

class T(Union):
    class Meta:
        types = (A, B, C)

the data maybe like:

{_type: A}
{_type:B, start_time: xxxx}
{_type:C,  start_time:xxx, end_time: xxx}

By the way, why an ObjectType or InputType must have fields?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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