This commit is contained in:
2024-11-01 09:50:19 +03:00
parent bcac627345
commit 5a9a02d3a4
11 changed files with 377 additions and 305 deletions

View File

@@ -13,6 +13,12 @@ enum ReactionSort {
dislike
}
enum ShoutsOrderBy {
last_reacted_at
rating
comments_count
}
enum ReactionKind {
# collabs

View File

@@ -54,17 +54,16 @@ input LoadShoutsFilters {
author: String
layouts: [String]
featured: Boolean
reacted: Boolean
reacted: Boolean # requires auth, used in load_shouts_feed
after: Int
}
input LoadShoutsOptions {
filters: LoadShoutsFilters
with_author_captions: Boolean
limit: Int!
random_limit: Int
offset: Int
order_by: String
order_by: ShoutsOrderBy
order_by_desc: Boolean
}

View File

@@ -24,21 +24,23 @@ type Query {
# reaction
load_reactions_by(by: ReactionBy!, limit: Int, offset: Int): [Reaction]
load_shout_comments(shout: Int!, limit: Int, offset: Int): [Reaction]
load_shout_ratings(shout: Int!, limit: Int, offset: Int): [Reaction]
load_comment_ratings(comment: Int!, limit: Int, offset: Int): [Reaction]
# reader
get_shout(slug: String, shout_id: Int): Shout
load_shouts_by(options: LoadShoutsOptions): [Shout]
load_shout_comments(shout: Int!, limit: Int, offset: Int): [Reaction]
load_shout_ratings(shout: Int!, limit: Int, offset: Int): [Reaction]
load_comment_ratings(comment: Int!, limit: Int, offset: Int): [Reaction]
load_shouts_search(text: String!, limit: Int, offset: Int): [SearchResult]
load_shouts_search(text: String!, options: LoadShoutsOptions): [SearchResult]
load_shouts_bookmarked(options: LoadShoutsOptions): [Shout]
load_shouts_random_topic(options: LoadShoutsOptions): CommonResult! # { topic shouts }
# feed
load_shouts_feed(options: LoadShoutsOptions): [Shout]
load_shouts_unrated(limit: Int, offset: Int): [Shout]
load_shouts_coauthored(limit: Int, offset: Int): [Shout]
load_shouts_discussed(limit: Int, offset: Int): [Shout]
load_shouts_random_top(options: LoadShoutsOptions): [Shout]
load_shouts_random_topic(limit: Int!): CommonResult! # { topic shouts }
load_shouts_bookmarked(limit: Int, offset: Int): [Shout]
load_shouts_unrated(options: LoadShoutsOptions): [Shout]
load_shouts_coauthored(options: LoadShoutsOptions): [Shout]
load_shouts_discussed(options: LoadShoutsOptions): [Shout]
load_shouts_random_top(options: LoadShoutsOptions): [Shout] # random order, fixed filter, limit offset can be used
# editor
get_my_shout(shout_id: Int!): CommonResult!