2023-12-05 22:18:45 +08:00
|
|
|
import { gql } from '@apollo/client';
|
|
|
|
|
2024-03-28 23:09:37 +08:00
|
|
|
export const CONNECTION_STATUS_REPORT_SUBSCRIPTION = gql`subscription ConnStatusReport {
|
2024-04-04 05:54:12 +08:00
|
|
|
user_connectionStatusReport(
|
|
|
|
where: {
|
|
|
|
_or: [
|
|
|
|
{ clientNotResponding: { _eq: true } },
|
|
|
|
{ lastUnstableStatus: { _is_null: false } }
|
|
|
|
]
|
|
|
|
}) {
|
2023-12-05 22:18:45 +08:00
|
|
|
user {
|
|
|
|
userId
|
|
|
|
name
|
|
|
|
avatar
|
|
|
|
color
|
|
|
|
isModerator
|
2024-08-28 22:08:30 +08:00
|
|
|
currentlyInMeeting
|
2023-12-05 22:18:45 +08:00
|
|
|
}
|
|
|
|
clientNotResponding
|
|
|
|
lastUnstableStatus
|
|
|
|
lastUnstableStatusAt
|
|
|
|
currentStatus
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
|
2024-04-03 21:01:08 +08:00
|
|
|
export const USER_CURRENT_STATUS_SUBSCRIPTION = gql`
|
|
|
|
subscription CurrentUserConnStatus($userId: String!) {
|
|
|
|
user_connectionStatusReport(
|
|
|
|
where: {
|
|
|
|
user: {
|
|
|
|
userId: { _eq: $userId }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
) {
|
|
|
|
currentStatus
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2024-03-28 23:09:37 +08:00
|
|
|
export const CONNECTION_STATUS_SUBSCRIPTION = gql`subscription ConnStatus {
|
2023-12-05 22:18:45 +08:00
|
|
|
user_connectionStatus {
|
|
|
|
connectionAliveAt
|
|
|
|
userClientResponseAt
|
|
|
|
status
|
|
|
|
statusUpdatedAt
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
|
|
|
|
export default CONNECTION_STATUS_REPORT_SUBSCRIPTION;
|