From efa3ecb17496b6d13156af8e358bc157076d3336 Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 13 Oct 2023 14:09:15 +0300 Subject: [PATCH] core-graphql-fix --- services/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/core.py b/services/core.py index feb7857..be981ff 100644 --- a/services/core.py +++ b/services/core.py @@ -9,8 +9,8 @@ headers = {"Content-Type": "application/json"} async def get_author(author_id): gql = { - "query": "query GetAuthor { getAuthor(author_id: Int!) { id slug userpic name lastSeen } }", - "operation": "GetAuthor", + "query": "query GetAuthorById { getAuthorById(author_id: Int!) { id slug userpic name lastSeen } }", + "operation": "GetAuthorById", "variables": {"author_id": author_id} } try: @@ -20,7 +20,7 @@ async def get_author(author_id): return None r = response.json() print(f"[services.core] got author: {r}") - author = r.get("data", {}).get("getAuthor") + author = r.get("data", {}).get("getAuthorbyId") return author except Exception: return None