diff --git a/resolvers/reaction.py b/resolvers/reaction.py index 4a3fe56a..b10de0bf 100644 --- a/resolvers/reaction.py +++ b/resolvers/reaction.py @@ -487,12 +487,16 @@ def apply_reaction_filters(by, q): shout_slug = by.get("shout") if shout_slug: q = q.filter(Shout.slug == shout_slug) + + shout_id = by.get("shout_id") + if shout_id: + q = q.filter(Shout.id == shout_id) shouts = by.get("shouts") if shouts: q = q.filter(Shout.slug.in_(shouts)) - created_by = by.get("created_by") + created_by = by.get("created_by", by.get("author_id")) if created_by: q = q.filter(Author.id == created_by) diff --git a/schema/input.graphql b/schema/input.graphql index c1637723..fba7b144 100644 --- a/schema/input.graphql +++ b/schema/input.graphql @@ -92,12 +92,14 @@ input LoadShoutsOptions { input ReactionBy { shout: String + shout_id: Int shouts: [String] search: String kinds: [ReactionKind] reply_to: Int # filter topic: String created_by: Int + author_id: Int author: String after: Int sort: ReactionSort # sort