feat: 添加API服务器配置和GraphQL路由,重载配置功能,更新日志信息

This commit is contained in:
墨梓柒
2025-05-04 13:43:30 +08:00
parent aa86387f36
commit 88a2b9d2ee
5 changed files with 136 additions and 101 deletions

View File

@@ -0,0 +1,22 @@
import strawberry
from fastapi import FastAPI
from strawberry.fastapi import GraphQLRouter
from src.common.server import global_server
@strawberry.type
class Query:
@strawberry.field
def hello(self) -> str:
return "Hello World"
schema = strawberry.Schema(Query)
graphql_app = GraphQLRouter(schema)
fast_api_app: FastAPI = global_server.get_app()
fast_api_app.include_router(graphql_app, prefix="/graphql")

View File

@@ -0,0 +1 @@
pass