minor fixes
This commit is contained in:
@@ -6,6 +6,7 @@ from resolvers.profile import get_user_by_slug, get_current_user
|
||||
from resolvers.topics import topic_subscribe, topic_unsubscribe, topics_by_author, \
|
||||
topics_by_community, topics_by_slugs
|
||||
from resolvers.comments import create_comment
|
||||
from resolvers.community import create_community, delete_community, get_community, get_communities
|
||||
|
||||
__all__ = [
|
||||
"login",
|
||||
@@ -30,5 +31,9 @@ __all__ = [
|
||||
"topics_by_community",
|
||||
"topics_by_author",
|
||||
"topic_subscribe",
|
||||
"topic_unsubscribe"
|
||||
"topic_unsubscribe",
|
||||
"create_community",
|
||||
"delete_community",
|
||||
"get_community",
|
||||
"get_communities"
|
||||
]
|
||||
|
@@ -64,10 +64,7 @@ async def get_community(_, info, slug):
|
||||
return { community }
|
||||
|
||||
@query.field("getCommunities")
|
||||
async def get_community(_, info, slugs):
|
||||
async def get_communities(_, info):
|
||||
with local_session() as session:
|
||||
communities = session.query(Community).filter(Community.slug in slugs)
|
||||
if not community:
|
||||
return {"error": "invalid community id"}
|
||||
|
||||
return { communities }
|
||||
communities = session.query(Community)
|
||||
return { communities }
|
Reference in New Issue
Block a user