Strawberry 0.13.2
Allow the usage of Union types in the mutations
@strawberry.type
class A:
x: int
@strawberry.type
class B:
y: int
@strawberry.type
class Mutation:
@strawberry.mutation
def hello(self, info) -> Union[A, B]:
return B(y=5)
schema = strawberry.Schema(query=A, mutation=Mutation)
query = """
mutation {
hello {
__typename
... on A {
x
}
... on B {
y
}
}
}
"""