fullfill graphql usertype; change db session to dep injection

This commit is contained in:
2026-05-20 14:40:05 +08:00
parent f3b7fedade
commit b95cce592f
4 changed files with 47 additions and 14 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ class Query:
@strawberry.field
async def me(self, info: Info[CustomContext, None]) -> Optional[UserType]:
# 从 context 获取当前登录用户
user = await info.context.get_current_user()
user = await info.context. xzz()
# Strawberry 会自动将 SQLAlchemy 实例映射为 UserType
return user