Files
bbs/bbs/api/queries/users.py
T
2022-02-20 00:57:12 +01:00

18 lines
397 B
Python

from typing import List
import strawberry
import strawberry_django
from django.contrib.auth.models import User as DjangoUser
from strawberry import ID
from bbs.api.types.users import User
@strawberry.type
class UsersQueries:
all_users: List[User] = strawberry_django.field()
@strawberry.field
def user(self, user_id: ID) -> User:
return DjangoUser.objects.get(pk=user_id)