Files
bbs/main/api/schema.py
T
Nikolai R Kristiansen ed99dadcb0 ⬆ Bump frontend deps
♻ Replace vite svg plugin
react-router v6 fixes
2022-02-05 21:44:25 +01:00

24 lines
676 B
Python

import strawberry
import strawberry_django
from main.api import mutations
from main.api.types import Order, Product, Transaction, User
@strawberry.type
class Query:
all_products: list[Product] = strawberry_django.field()
all_users: list[User] = strawberry_django.field()
all_orders: list[Order] = strawberry_django.field()
order_list: list[Order] = strawberry_django.field(pagination=True)
transaction_list: list[Transaction] = strawberry_django.field(pagination=True)
@strawberry.type
class Mutation:
create_order = mutations.create_order
create_deposit = mutations.create_deposit
schema = strawberry.Schema(query=Query, mutation=Mutation)