As the title describes, the strawberry.type
decorator lacks the option to set global permission classes, making the code repetitive and highly verbose, improving also DX.
Making a whole query protected with the same permission would result like this:
@strawberry.type
class Query:
user: str = strawberry.field(permission_classes=[IsAuthenticated])
x1: str = strawberry.field(permission_classes=[IsAuthenticated])
x2: str = strawberry.field(permission_classes=[IsAuthenticated])
x3: str = strawberry.field(permission_classes=[IsAuthenticated])
x4: str = strawberry.field(permission_classes=[IsAuthenticated])
@strawberry.type(permission_classes=[IsAuthenticated])
class Query:
user: str
x1: str
x2: str
x3: str
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