feature/IO-3096-GlobalNotifications - Checkpoint - Notification Center

This commit is contained in:
Dave Richer
2025-02-24 16:02:55 -05:00
parent 0f067fc503
commit b395839b37
9 changed files with 476 additions and 24 deletions

View File

@@ -0,0 +1,49 @@
import { gql } from "@apollo/client";
export const GET_NOTIFICATIONS = gql`
query GetNotifications($limit: Int!, $offset: Int!, $where: notifications_bool_exp) {
notifications(limit: $limit, offset: $offset, order_by: { created_at: desc }, where: $where) {
id
jobid
associationid
scenario_text
fcm_text
scenario_meta
created_at
read
}
}
`;
export const GET_UNREAD_COUNT = gql`
query GetUnreadCount {
notifications_aggregate(where: { read: { _is_null: true } }) {
aggregate {
count
}
}
}
`;
export const MARK_ALL_NOTIFICATIONS_READ = gql`
mutation MarkAllNotificationsRead {
update_notifications(where: { read: { _is_null: true } }, _set: { read: "now()" }) {
affected_rows
}
}
`;
export const SUBSCRIBE_TO_NOTIFICATIONS = gql`
subscription SubscribeToNotifications {
notifications(order_by: { created_at: desc }, limit: 1) {
id
jobid
associationid
scenario_text
fcm_text
scenario_meta
created_at
read
}
}
`;