from webapi.bootstrap.application import create_app from webapi.config.site_settings import site_settings from fastapi.responses import RedirectResponse from fastapi.middleware.cors import CORSMiddleware from strawberry.fastapi import GraphQLRouter from strawberry.fastapi.handlers import GraphQLTransportWSHandler, GraphQLWSHandler import uvicorn from typing import Any app = create_app() @app.get("/", status_code=301) async def root(): """ TODO: redirect client to /doc# """ return RedirectResponse("docs") if __name__ == "__main__": uvicorn.run(app="main:app", host=site_settings.SERVER_HOST, port=site_settings.SERVER_PORT) def get_context() -> Any: # Define your context function. This is where you can set up authentication, database connections, etc. return {} def get_root_value() -> Any: # Define your root value function. This can be used to customize the root value for GraphQL operations. return {}