2024-04-06 06:30:58 +08:00
|
|
|
import { gql } from '@apollo/client';
|
|
|
|
|
|
|
|
export interface UnreadChatsSubscriptionResponse {
|
|
|
|
chat: Array<{
|
|
|
|
chatId: string;
|
|
|
|
totalUnread: number;
|
|
|
|
participant?: {
|
|
|
|
name: string;
|
|
|
|
};
|
|
|
|
}>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const UNREAD_CHATS_SUBSCRIPTION = gql`
|
2024-05-08 00:26:56 +08:00
|
|
|
subscription unreadChatsSubscription {
|
2024-04-06 06:30:58 +08:00
|
|
|
chat(
|
|
|
|
where: {
|
|
|
|
totalUnread: { _gt: 0 },
|
|
|
|
visible: { _eq: true }
|
|
|
|
}
|
|
|
|
) {
|
|
|
|
chatId
|
|
|
|
totalUnread
|
|
|
|
participant {
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default {
|
|
|
|
UNREAD_CHATS_SUBSCRIPTION,
|
|
|
|
};
|