Closed s3rius closed 3 years ago
This pull request adds functionality that was requested in #34, #138 and #56.
Additionally you can now use django-graphql-jwt.
E.G.:
import graphene
from typing import Any
from graphql import GraphQLResolveInfo
from models import RandomModel
from types import RandomType
from graphene_django_extras import DjangoFilterPaginateListField
from graphql_jwt.decorators import login_required
class MyQuery(graphene.ObjectType):
protected_list = DjangoFilterPaginateListField(RandomType)
@staticmethod
@login_required
def resolve_protected_list(root: None, info: GraphQLResolveInfo, **_kwargs: Any):
return RandomModel.objects.filter(user=info.context.user)
Description: This commit adds logic to use custom user resolvers instead of using only default manager queryset.
Signed-off-by: Pavel Kirilin win10@list.ru