topicall
This commit is contained in:
parent
b489760617
commit
aecdcb09e6
|
@ -4,7 +4,7 @@ from resolvers.zine import create_shout, get_shout_by_slug, top_month, top_overa
|
|||
recent_shouts, top_authors, top_viewed
|
||||
from resolvers.profile import get_user_by_slug, get_current_user, authors_by_slugs
|
||||
from resolvers.topics import topic_subscribe, topic_unsubscribe, topics_by_author, \
|
||||
topics_by_community, topics_by_slugs
|
||||
topics_by_community, topics_by_slugs, topics_all
|
||||
from resolvers.comments import create_comment
|
||||
from resolvers.community import create_community, delete_community, get_community, get_communities
|
||||
|
||||
|
@ -27,6 +27,7 @@ __all__ = [
|
|||
"top_month",
|
||||
"top_overall",
|
||||
"top_viewed",
|
||||
"topics_all",
|
||||
"topics_by_slugs",
|
||||
"topics_by_community",
|
||||
"topics_by_author",
|
||||
|
|
|
@ -5,6 +5,14 @@ from resolvers.zine import ShoutSubscriptions
|
|||
from auth.authenticate import login_required
|
||||
import asyncio
|
||||
|
||||
|
||||
@query.field("topicsAll")
|
||||
async def topics_ball(_, info):
|
||||
topics = []
|
||||
with local_session() as session:
|
||||
topics = session.query(Topic)
|
||||
return topics
|
||||
|
||||
@query.field("topicsBySlugs")
|
||||
async def topics_by_slugs(_, info, slugs):
|
||||
topics = []
|
||||
|
|
|
@ -143,6 +143,7 @@ type Query {
|
|||
topAuthors(limit: Int): [User]!
|
||||
|
||||
# topics
|
||||
topicsAll: [Topic]!
|
||||
topicsBySlugs(slugs: [String]!): [Topic]!
|
||||
topicsByCommunity(community: String!): [Topic]!
|
||||
topicsByAuthor(author: String!): [Topic]!
|
||||
|
|
Loading…
Reference in New Issue
Block a user