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

15 lines
483 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