https://play.strawberry.rocks/?gist=fe96e2b9b9b749d6b0a8c497d81f21cc
from typing import Optional, Union
import strawberry
@strawberry.type
class UnionTypeOne:
field: str
# this is missing a @strawberry.type
class UnionTypeTwo:
field: str
United = Union[
UnionTypeOne,
UnionTypeTwo,
]
@strawberry.type
class Transaction:
title: str
details: Optional[United] = None
@strawberry.type
class Query:
@strawberry.field
def test(self) -> Transaction:
return Transaction(title="title")
schema = strawberry.Schema(query=Query)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too