bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/polling/polling-graphql/queries.ts

54 lines
1.0 KiB
TypeScript
Raw Normal View History

import { gql } from '@apollo/client';
export interface HasPendingPollResponse {
meeting: Array<{
polls: Array<{
users: Array<{
userId: string;
responded: boolean;
}>;
options: Array<{
optionDesc: string;
optionId: number;
pollId: string;
}>;
multipleResponses: boolean;
pollId: string;
questionText: string;
secret: boolean;
type: string;
}>;
}>;
}
export const hasPendingPoll = gql`
subscription hasPendingPoll($userId: String!) {
meeting {
polls(
where: {
ended: { _eq: false }
2024-01-23 03:59:09 +08:00
users: { responded: { _eq: false }, userId: { _eq: $userId } },
userCurrent: { responded: { _eq: false } }
}
) {
users {
responded
userId
}
options {
optionDesc
optionId
pollId
}
multipleResponses
pollId
questionText
secret
type
}
}
}
`;
export default { hasPendingPoll };