I've implemented jwt authentication in django using Django-graphql-jwt library, now I want to allow get/post on my endpoint (/graphql) only for requests with JWT token. There are examples in django-graphql-jwt documentation like @login_required, but I don't want to put a decorator above every query and mutation. So, I've decided to restrict an access to a view. I added path('graphql/', PrivateGraphQLView.as_view()) in url.py but how can I implement request checking for a valid token in the header?
from graphene_django.views import GraphQLView
class PrivateGraphQLView(GraphQLView):
pass