This repository has been archived by the owner on Jul 8, 2023. It is now read-only.
Permission Directives when deploying scema through GraphQLHTTPConsumer #138
Labels
enhancement
New feature or request
Hi there. Thanks for all the work you are putting into keeping GraphQL alive for django.
I have run into the following issue. In order to be able to use subscription with Django and Channels I am currently deploying my schema like so:
My TokenAuthMiddlewareStack retrieves the user and injects it into the scope so it is accessible in resolvers through info.context.request.scope['user']. When attempting to use permission directives in a query like gql.django.field(directives=[IsAuthenticated()]) the following exception is thrown:
I am guessing you are expecting a request object there that would be available if the schema was exposed through a view. Is there some other way making a request object available that I am missing here ? Are there plans to support this sort of setup? I saw that @bellini666 is using subscriptions together with this package so I am guessing there is either another way to make subscriptions available or something is missing in my current setup.
The text was updated successfully, but these errors were encountered: