I'm trying to make an input filter option in Strawberry.
@strawberry.input
class FilterOptions:
is_: Optional[bool] = strawberry.field(default=None, name="is")
As "is" is a reserved keyword in Python I can't use it as a field directly, so I alias it with strawberry.field(default=None, name="is")
However, if I do the above I get the following error:
TypeError: issubclass() arg 1 must be a class
pydantic/validators.py:751: TypeError
....
RuntimeError: error checking inheritance of <strawberry.type.StrawberryOptional object at 0x7f3503564dd0> (type: StrawberryOptional)
But If I make the field non-optional like below, it works:
@strawberry.input
class FilterOptions:
is_: bool = strawberry.field(default=None, name="is")
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