needed queries

This commit is contained in:
Untone 2021-10-30 19:58:15 +03:00
parent 741ede054d
commit ee53fe7508
2 changed files with 12 additions and 6 deletions

View File

@ -93,6 +93,12 @@ class TopShouts:
async with TopShouts.lock:
TopShouts.shouts_by_rating = shouts
@staticmethod
async def prepare_shouts_by_time():
month_ago = datetime.now() - timedelta(days = 30)
with local_session() as session:
# TODO: select recent shouts
@staticmethod
async def prepare_favorites_shouts():
with local_session() as session:

View File

@ -98,12 +98,12 @@ type Query {
getMessages(count: Int = 100, page: Int = 1): [Message!]!
# shouts
getShoutBySlug(slug: String!): Shout! # NOTE: with .comments: Comments[]
# getShoutRating(shout: Int): Int!
# shoutsByAuthor(author: Int): [Shout]!
# shoutsByReplyTo(shout: Int): [Shout]!
# shoutsByTags(tags: [String]): [Shout]!
# shoutsByTime(time: DateTime): [Shout]!
getShoutBySlug(slug: String!): Shout!
# NOTE: with .comments: Comments[]
recentShouts(limit: Int): [Shout]!
shoutsByTopic(topic: String!, limit: Int!): [Shout]!
shoutsByAuthor(author: String!, limit: Int!): [Shout]!
shoutsByCommunity(community: String!, limit: Int!): [Shout]!
# mainpage
topShoutsByView(limit: Int): [Shout]!