See this toy example schema with the newly detected type error in comments:
Slug = strawberry.scalar(
str,
serialize=lambda x: x,
parse_value=lambda x: x,
)
@strawberry.type
class Organisation:
@strawberry.field
def slug(self) -> Slug: # error: Variable not allowed in type expression (reportGeneralTypeIssues)
...
Pyright complains that a variable is not allowed in type expression, which seems like a legit complaint to me.
The custom scalar type use case can be probably achieved more elegantly / correctly w.r.t. static types using typing.Annotated
?
strawberry
: 0.217.0
pyright
: 1.1.344
(not detected in 1.1.343
)
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