✨ UserDetail and UserList views
This commit is contained in:
1 parent
ec0549154d
commit
e2a84c25a6
16 files changed
+201
-22
No files matched your search
@@ -1,5 +1,7 @@
|
||||
import strawberry
|
||||
import strawberry_django
|
||||
from django.contrib.auth.models import User as DjangoUser
|
||||
from strawberry import ID
|
||||
|
||||
from main import models
|
||||
from main.api import mutations
|
||||
@@ -23,6 +25,10 @@ class Query:
|
||||
order_list: list[Order] = strawberry_django.field(pagination=True, order=OrderOrdering)
|
||||
transaction_list: list[Transaction] = strawberry_django.field(pagination=True, order=TransactionOrdering)
|
||||
|
||||
@strawberry.field
|
||||
def user(self, user_id: ID) -> User:
|
||||
return DjangoUser.objects.get(pk=user_id)
|
||||
|
||||
@strawberry.field
|
||||
def order_stats(self) -> OrderStats:
|
||||
return OrderStats(
|
||||
|
||||
Reference in new issue
Block a user