strawberry-django-plus
strawberry-django-plus copied to clipboard
Permissions: applying IsAuthenticated directive to entire schema
Hi there,
Instead of applying the IsAuthenticated()
directive to individual fields, I'm looking to apply this to an entire schema.
I'd wondered if this might work, but it doesn't:
authenticated_schema = gql.Schema(
query=AuthenticatedQueries,
mutation=AuthenticatedMutations,
extensions=[SchemaDirectiveExtension],
directives=[IsAuthenticated()]
)
I get a type error:
Expected type 'Iterable[StrawberryDirective]', got 'list[IsAuthenticated]' instead
And an actual error:
AttributeError: 'IsAuthenticated' object has no attribute 'arguments'
.
Any thoughts?