♻ Split types, mutations, queries by model

This commit is contained in:
nikolark committed 2022-02-19 14:31:05 +01:00
1 parent 3274cb96c0
commit 41638e605f
13 files changed
+193 -156

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import strawberry
import strawberry_django
from django.contrib.auth.models import User as DjangoUser
from strawberry import ID
from main.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)