notifier/resolvers/schema.py
2024-01-26 03:40:49 +03:00

17 lines
498 B
Python

import strawberry
from strawberry.schema.config import StrawberryConfig
from resolvers.load import Query
from resolvers.seen import Mutation
from services.auth import LoginRequiredMiddleware
from services.db import Base, engine
schema = strawberry.Schema(
query=Query, mutation=Mutation, config=StrawberryConfig(auto_camel_case=False), extensions=[LoginRequiredMiddleware]
)
# Create the specified tables if they do not already exist
Base.metadata.create_all(bind=engine, checkfirst=True)