This snippet is broken, because we don't check nested type var, we have done something similar here: #3463
import strawberry
@strawberry.type
class Wrapper[T]:
value: T
@strawberry.type
class BlockRow[T]:
item: Wrapper[T]
@strawberry.type
class Query:
@strawberry.field
def blocks(self) -> list[BlockRow[str] | BlockRow[int]]:
return [
BlockRow(item=Wrapper(value="Hello")),
BlockRow(item=Wrapper(value=1)),
]
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