diff --git a/backend/src/schema/resolvers/notifications.js b/backend/src/schema/resolvers/notifications.js index 93feb3781..8d0683258 100644 --- a/backend/src/schema/resolvers/notifications.js +++ b/backend/src/schema/resolvers/notifications.js @@ -78,4 +78,10 @@ export default { return notification }, }, + NOTIFIED: { + id: async (parent) => { + // serialize an ID to help the client update the cache + return `${parent.reason}/${parent.from.id}/${parent.to.id}` + } + } } diff --git a/backend/src/schema/types/type/NOTIFIED.gql b/backend/src/schema/types/type/NOTIFIED.gql index 42da6a39b..1182f2743 100644 --- a/backend/src/schema/types/type/NOTIFIED.gql +++ b/backend/src/schema/types/type/NOTIFIED.gql @@ -1,4 +1,5 @@ type NOTIFIED { + id: ID! from: NotificationSource to: User createdAt: String diff --git a/webapp/components/NotificationMenu/NotificationMenu.spec.js b/webapp/components/NotificationMenu/NotificationMenu.spec.js index 2145b7d6e..87576a5f3 100644 --- a/webapp/components/NotificationMenu/NotificationMenu.spec.js +++ b/webapp/components/NotificationMenu/NotificationMenu.spec.js @@ -50,7 +50,7 @@ describe('NotificationMenu.vue', () => { beforeEach(() => { data = () => { return { - displayedNotifications: [ + notifications: [ { id: 'notification-41', read: true, @@ -85,7 +85,7 @@ describe('NotificationMenu.vue', () => { beforeEach(() => { data = () => { return { - displayedNotifications: [ + notifications: [ { id: 'notification-41', read: false, diff --git a/webapp/components/NotificationMenu/NotificationMenu.vue b/webapp/components/NotificationMenu/NotificationMenu.vue index 79a16157c..ff50ea1e9 100644 --- a/webapp/components/NotificationMenu/NotificationMenu.vue +++ b/webapp/components/NotificationMenu/NotificationMenu.vue @@ -1,5 +1,5 @@