fullfill graphql usertype; change db session to dep injection
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user