Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Permissions: applying IsAuthenticated directive to entire schema #187

@gghdev

Description

@gghdev

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions