From a0fd78566b5e44fdc7ae567b14904061236ad141 Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 13 Oct 2023 14:19:18 +0300 Subject: [PATCH] core-query-format-fix --- services/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/core.py b/services/core.py index be981ff..1410ada 100644 --- a/services/core.py +++ b/services/core.py @@ -9,7 +9,7 @@ headers = {"Content-Type": "application/json"} async def get_author(author_id): gql = { - "query": "query GetAuthorById { getAuthorById(author_id: Int!) { id slug userpic name lastSeen } }", + "query": "query GetAuthorById { getAuthorById(author_id: $author_id) { id slug userpic name lastSeen } }", "operation": "GetAuthorById", "variables": {"author_id": author_id} } @@ -28,7 +28,7 @@ async def get_author(author_id): async def get_network(author_id, limit=50, offset=0) -> list: gql = { - "query": "query LoadAuthors { authorFollowings(author_id: Int!, limit: Int, offset: Int) { id slug userpic name } }", + "query": "query LoadAuthors { authorFollowings(author_id: $author_id, limit: $limit, offset: $offset) { id slug userpic name } }", "operation": "LoadAuthors", "variables": { "author_id": author_id, @@ -59,7 +59,7 @@ async def get_network(author_id, limit=50, offset=0) -> list: async def get_followers(author_id, amount): gql = { - "query": "query LoadAuthors { authorFollowers(author_id: Int!, limit: Int) { id slug userpic name } }", + "query": "query LoadAuthors { authorFollowers(author_id: $author_id, limit: $limit) { id slug userpic name } }", "operation": "LoadAuthors", "variables": { "author_id": author_id,