取得 Ticket
export const TICKET_ISSUE = gql`
mutation TicketIssue {
ticketIssue {
ticket
expiredAt
}
}
`;
type TicketIssueResponse = {
ticketIssue: {
ticket?: string;
expiredAt?: string; // iso 8601
};
};
function main() {
// ...
const [ticketIssue] = useMutation<TicketIssueResponse>(ISSUE_TICKET);
function createTicket() {
const ticketResult = await ticketIssue();
console.log(ticketResult.data?.ticketIssue.ticket)
return ticketResult
}
// ...
}
Last updated