2023-10-27 22:19:46 +08:00
|
|
|
import { gql } from '@apollo/client';
|
|
|
|
import { BreakoutUser } from './room-managment-state/types';
|
|
|
|
|
|
|
|
export interface getUserResponse {
|
|
|
|
user: Array<BreakoutUser>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface breakoutRoom {
|
|
|
|
sequence: number;
|
|
|
|
name: string;
|
2023-10-30 21:06:17 +08:00
|
|
|
breakoutRoomId: string;
|
2023-10-27 22:19:46 +08:00
|
|
|
participants: Array<{
|
|
|
|
user: {
|
|
|
|
name: string;
|
|
|
|
userId: string;
|
|
|
|
isModerator: boolean;
|
|
|
|
}
|
|
|
|
}>
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface getBreakoutsResponse {
|
|
|
|
breakoutRoom: Array<breakoutRoom>
|
|
|
|
}
|
|
|
|
|
|
|
|
export const getUser = gql`
|
|
|
|
query getUser {
|
|
|
|
user(
|
|
|
|
order_by: [
|
|
|
|
{role: asc},
|
|
|
|
{raiseHandTime: asc_nulls_last},
|
|
|
|
{awayTime: asc_nulls_last},
|
|
|
|
{emojiTime: asc_nulls_last},
|
|
|
|
{isDialIn: desc},
|
|
|
|
{hasDrawPermissionOnCurrentPage: desc},
|
|
|
|
{nameSortable: asc},
|
|
|
|
{userId: asc}
|
|
|
|
]) {
|
|
|
|
userId
|
|
|
|
name
|
|
|
|
isModerator
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const getBreakouts = gql`
|
|
|
|
query getBreakouts {
|
|
|
|
breakoutRoom {
|
|
|
|
sequence
|
|
|
|
name
|
|
|
|
breakoutRoomId
|
|
|
|
participants {
|
|
|
|
user {
|
|
|
|
name
|
|
|
|
userId
|
|
|
|
isModerator
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const getBreakoutCount = gql`
|
|
|
|
query getBreakoutCount {
|
|
|
|
breakoutRoom_aggregate {
|
|
|
|
aggregate {
|
|
|
|
count
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default {
|
|
|
|
getUser,
|
|
|
|
getBreakouts,
|
|
|
|
};
|