Skip to content
Snippets Groups Projects
Commit a7a194d0 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Add more fields to graphene user type

parent 512b69f1
No related branches found
No related tags found
2 merge requests!1123Resolve "Finalise Vuetify app as SPA",!1066Translations update from Weblate
Pipeline #104205 canceled
from django.contrib.auth import get_user_model
import graphene
class UserType(graphene.ObjectType):
username = graphene.String()
first_name = graphene.String()
last_name = graphene.String()
is_authenticated = graphene.Boolean(required=True)
is_anonymous = graphene.Boolean(required=True)
def resolve_is_authenticated(root: get_user_model(), info, **kwargs):
return root.is_authenticated
def resolve_is_anonymous(root: get_user_model(), info, **kwargs):
return root.is_anonymous
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment