diff --git a/orm/reaction.py b/orm/reaction.py index 4581eb4..c45df75 100644 --- a/orm/reaction.py +++ b/orm/reaction.py @@ -20,7 +20,7 @@ class ReactionKind(Enumeration): REJECT = 8 # -1 # public feed - QUOTE = 9 # +0 bookmark + QUOTE = 9 # +0 COMMENT = 0 # +0 LIKE = 11 # +1 DISLIKE = 12 # -1 diff --git a/services/core.py b/services/core.py index e5dd779..d22e8fe 100644 --- a/services/core.py +++ b/services/core.py @@ -28,13 +28,13 @@ async def _request_endpoint(query_name, body): async def get_author(author_id) -> Author: - query_name = "getAuthor" + query_name = "get_author" query_type = "query" operation = "GetAuthor" query_fields = "id slug pic name" gql = { - "query": query_type + " " + operation + " { " + query_name + " { " + query_fields + "ΠΌ} " + " }", + "query": query_type + " " + operation + " { " + query_name + " { " + query_fields + "} " + " }", "operationName": operation, "variables": None, } @@ -43,13 +43,19 @@ async def get_author(author_id) -> Author: async def get_followed_shouts(author_id: int) -> List[Shout]: - query_name = "getFollowedShouts" + query_name = "load_shouts_followed" query_type = "query" operation = "GetFollowedShouts" query_fields = "id slug title" - query = f"{query_type} {operation}($author_id: Int!) {{ {query_name}(author_id: $author_id) {{ {query_fields} }} }}" + query = f"""{query_type} {operation}($author_id: Int!, limit: Int, offset: Int) {{ + {query_name}(author_id: $author_id, limit: $limit, offset: $offset) {{ {query_fields} }} + }}""" - body = {"query": query, "operationName": operation, "variables": {"author_id": author_id}} + body = { + "query": query, + "operationName": operation, + "variables": {"author_id": author_id, "limit": 1000, "offset": 0}, # FIXME: too big + } return await _request_endpoint(query_name, body)