return user ratings; add getUsersBySlugs

This commit is contained in:
knst-kotov
2021-12-11 19:38:54 +03:00
parent d578072563
commit e8780cfb86
4 changed files with 12 additions and 29 deletions

View File

@@ -353,7 +353,6 @@ async def view_shout(_, info, shout_id):
@query.field("getShoutBySlug")
async def get_shout_by_slug(_, info, slug):
all_fields = [node.name.value for node in info.field_nodes[0].selection_set.selections]
print(all_fields)
selected_fields = set(["authors", "comments", "topics"]).intersection(all_fields)
select_options = [selectinload(getattr(Shout, field)) for field in selected_fields]