Files
bbs/main/api/schema.py
T
Nikolai R Kristiansen dcd8edaaa6 🚨 Add pre-commit
Format code
Add bin/run
2022-01-16 22:49:21 +01:00

22 lines
509 B
Python

import strawberry
import strawberry_django
from main.api import mutations
from main.api.types import Order, Product, 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()
@strawberry.type
class Mutation:
create_order = mutations.create_order
create_deposit = mutations.create_deposit
schema = strawberry.Schema(query=Query, mutation=Mutation)