Files
bbs/main/api/schema.py
T
nikolark 0a435d3224 ✨ Start on error handling
♻ Use TypedDocumentNode's instead of apollo-react-typescript codegen
💄 Add toast
2021-11-06 21:49:28 +01:00

21 lines
463 B
Python

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