getTopic, getAuthor

This commit is contained in:
2022-11-10 09:51:40 +03:00
parent 503d6daa93
commit 1720f00839
3 changed files with 16 additions and 1 deletions

View File

@@ -53,6 +53,13 @@ async def topics_by_author(_, _info, author):
return list(author_topics)
@query.field("getTopic")
async def get_topic(_, _info, slug):
t = await TopicStorage.topics[slug]
t.stat = get_topic_stat(slug)
return t
@mutation.field("createTopic")
@login_required
async def create_topic(_, _info, inp):