lamassu-server/packages/server/lib/new-admin/graphql/resolvers/notification.resolver.js
2025-05-12 15:35:00 +01:00

16 lines
492 B
JavaScript

const notifierQueries = require('../../../notifier/queries')
const resolvers = {
Query: {
notifications: () => notifierQueries.getNotifications(),
hasUnreadNotifications: () => notifierQueries.hasUnreadNotifications(),
alerts: () => notifierQueries.getAlerts(),
},
Mutation: {
toggleClearNotification: (...[, { id, read }]) =>
notifierQueries.setRead(id, read),
clearAllNotifications: () => notifierQueries.markAllAsRead(),
},
}
module.exports = resolvers