From f089d4903be32e4d041fcba3f1c1bdbc13c5a5d5 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Tue, 15 Nov 2022 13:30:09 +0300 Subject: [PATCH] published-fix --- resolvers/zine.py | 6 +++--- schema.graphql | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/resolvers/zine.py b/resolvers/zine.py index 0a6b6be4..363ab91e 100644 --- a/resolvers/zine.py +++ b/resolvers/zine.py @@ -21,7 +21,7 @@ async def load_shouts_by(_, info, by, amount=50, offset=0): """ :param by: { layout: 'audio', - published: true, + visibility: "public", author: 'discours', topic: 'culture', title: 'something', @@ -49,8 +49,8 @@ async def load_shouts_by(_, info, by, amount=50, offset=0): if by.get("reacted"): user = info.context["request"].user q = q.filter(Reaction.createdBy == user.slug) - if by.get("published"): - q = q.filter(Shout.publishedAt.is_not(None)) + if by.get("visibility"): + q = q.filter(Shout.visibility == by.get("visibility") or "public") if by.get("layout"): q = q.filter(Shout.layout == by["layout"]) if by.get("author"): diff --git a/schema.graphql b/schema.graphql index 38708d5b..10f435da 100644 --- a/schema.graphql +++ b/schema.graphql @@ -218,7 +218,6 @@ input ShoutsBy { topic: String author: String layout: String - published: Boolean visibility: String order: String days: Int