From 88ca5a136255eb1c402706932f14d4ad6b1b78ca Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 4 Mar 2024 10:59:14 +0300 Subject: [PATCH] notifier-schema-fix --- resolvers/__init__.py | 13 ++++++++++++- resolvers/notifier.py | 2 +- schema/query.graphql | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/resolvers/__init__.py b/resolvers/__init__.py index d464237e..47aced0b 100644 --- a/resolvers/__init__.py +++ b/resolvers/__init__.py @@ -42,7 +42,12 @@ from resolvers.topic import ( get_topics_by_community, ) - +from resolvers.notifier import ( + load_notifications, + notification_mark_seen, + notifications_seen_after, + notifications_seen_thread +) __all__ = [ # author @@ -88,4 +93,10 @@ __all__ = [ 'update_reaction', 'delete_reaction', 'load_reactions_by', + + # notifier + 'load_notifications', + 'notifications_seen_thread', + 'notifications_seen_after', + 'notification_mark_seen' ] diff --git a/resolvers/notifier.py b/resolvers/notifier.py index 41d58bea..dc9dcedb 100644 --- a/resolvers/notifier.py +++ b/resolvers/notifier.py @@ -167,7 +167,7 @@ def get_notifications_grouped(author_id: int, after: int = 0, limit: int = 10): existing_group['reactions'].append(payload) groups_by_thread[thread_id] = existing_group else: - group = group_reaction(payload, seen, notification.action) + group = group_reaction(payload, seen, notification.action) # NOTE: last action will be group-wise if group: groups_by_thread[thread_id] = group groups_amount += 1 diff --git a/schema/query.graphql b/schema/query.graphql index 4e6fd28f..28182f0a 100644 --- a/schema/query.graphql +++ b/schema/query.graphql @@ -43,5 +43,5 @@ type Query { get_topics_by_community(slug: String, community_id: Int): [Topic] # notifier - get_notifications: NotificationsResult! + load_notifications(after: Int!, limit: Int): NotificationsResult! }