From 25dd0ba553aa6e0ca160c8a1bafe24388ded8241 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Sat, 12 Nov 2022 21:13:23 +0300 Subject: [PATCH] shoutsByLayout, no checks --- CHECKS | 5 ----- migration/extract.py | 2 +- schema.graphql | 24 +++++++++++++++++------- 3 files changed, 18 insertions(+), 13 deletions(-) delete mode 100644 CHECKS diff --git a/CHECKS b/CHECKS deleted file mode 100644 index 5affecfc..00000000 --- a/CHECKS +++ /dev/null @@ -1,5 +0,0 @@ -WAIT=30 -TIMEOUT=10 -ATTEMPTS=60 # 60 * 30 = 30 min - -/ Playground diff --git a/migration/extract.py b/migration/extract.py index 674b29f1..ba1aa23a 100644 --- a/migration/extract.py +++ b/migration/extract.py @@ -347,7 +347,7 @@ def prepare_html_body(entry): def extract_html(entry): - body_orig = entry.get("body").replace('\(', '(').replace('/)', ')') or "" + body_orig = (entry.get("body") or "").replace('\(', '(').replace('/)', ')') media = entry.get("media", []) kind = entry.get("type") or "" print("[extract] kind: " + kind) diff --git a/schema.graphql b/schema.graphql index 7661929b..9a1b8f14 100644 --- a/schema.graphql +++ b/schema.graphql @@ -26,12 +26,21 @@ type AuthResult { type ChatMember { slug: String! name: String! - pic: String + userpic: String invitedAt: DateTime invitedBy: String # user slug # TODO: add more } +type Author { + slug: String! + name: String + userpic: String + stat: AuthorStat + roles: [Role] # in different communities + lastSeen: DateTime +} + type Result { error: String uids: [String] @@ -43,8 +52,8 @@ type Result { members: [ChatMember] shout: Shout shouts: [Shout] - author: User - authors: [User] + author: Author + authors: [Author] reaction: Reaction reactions: [Reaction] topic: Topic @@ -212,19 +221,20 @@ type Query { signOut: AuthResult! # profile - getUsersBySlugs(slugs: [String]!): [User]! - userFollowers(slug: String!): [User]! - userFollowedAuthors(slug: String!): [User]! + getUsersBySlugs(slugs: [String]!): [Author]! + userFollowers(slug: String!): [Author]! + userFollowedAuthors(slug: String!): [Author]! userFollowedTopics(slug: String!): [Topic]! userFollowedCommunities(slug: String!): [Community]! userReactedShouts(slug: String!): [Shout]! # test getUserRoles(slug: String!): [Role]! - authorsAll: [User]! + authorsAll: [Author]! getAuthor(slug: String!): User! # shouts getShoutBySlug(slug: String!): Shout! shoutsForFeed(offset: Int!, limit: Int!): [Shout]! # test + shoutsByLayout(layout: String, amount: Int!, offset: Int!): [Shout]! shoutsByTopics(slugs: [String]!, offset: Int!, limit: Int!): [Shout]! shoutsByAuthors(slugs: [String]!, offset: Int!, limit: Int!): [Shout]! shoutsByCommunities(slugs: [String]!, offset: Int!, limit: Int!): [Shout]!