Here a code example
@strawberry.type
class Sub:
@strawberry.field
def foo(self) -> str:
return "bar"
@strawberry.type
class Query:
sub: Sub = strawberry.field(default_factory=Sub)
schema = strawberry.Schema(query=Query)
# this fails
result = schema.execute_sync(
"""
query TestQuery{
sub {
foo
}
}
"""
)
Solution: initialize also the root schema or provide a fallback for None in get_result
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