From 806fb5f6f712116b4f441807ad0826c88beeb787 Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 13 Oct 2023 16:35:16 +0300 Subject: [PATCH] b --- services/core.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/core.py b/services/core.py index 9ca21ad..c93a7bb 100644 --- a/services/core.py +++ b/services/core.py @@ -13,18 +13,18 @@ async def get_author(author_id): "operation": "GetAuthorById", "variables": {"author_id": author_id} } - try: - async with AsyncClient() as client: + async with AsyncClient() as client: + try: response = await client.post(API_BASE, headers=headers, data=json.dumps(gql)) print(f"[services.core] get_author response: {response.status_code} {response.text}") if response.status_code != 200: return None r = response.json() - print(f"[services.core] got author: {r}") - author = r.get("data", {}).get("getAuthorbyId") + author = r.get("data", {}).get("getAuthorById") return author - except Exception: - return None + + except Exception: + return None async def get_network(author_id:int, limit:int = 50, offset:int = 0) -> list: