get-author-fix-2
All checks were successful
deploy / deploy (push) Successful in 1m1s

This commit is contained in:
2023-12-18 02:53:25 +03:00
parent f20f5adedf
commit eb6ccdc481

View File

@@ -62,23 +62,16 @@ async def get_my_followed() -> List[ChatMember]:
return []
async def get_author(author_id: int = None, slug: str = "", user: str = ""):
query_name = "get_author(author_id: $author_id, slug: $slug, user: $user)"
async def get_author(user: str = ""):
query_name = "get_author_id(user: $user)"
query_type = "query"
operation = "GetAuthor($author_id: Int, $slug: String, $user: String)"
query_fields = "id slug pic name"
vars = {}
if author_id:
vars["author_id"] = author_id
elif slug:
vars["slug"] = slug
elif user:
vars["user"] = user
gql = {
"query": query_type + " " + operation + " { " + query_name + " { " + query_fields + "} " + " }",
"operationName": operation,
"variables": None if vars == {} else vars,
"variables": {"user": user},
}
r = await _request_endpoint(query_name, gql)