2023-05-20 02:30:24 +08:00
|
|
|
import { gql } from '@apollo/client';
|
|
|
|
|
|
|
|
type chatContent = {
|
|
|
|
chatId: string;
|
|
|
|
public: boolean;
|
|
|
|
participant: {
|
|
|
|
name: string;
|
|
|
|
};
|
2023-07-08 04:46:36 +08:00
|
|
|
};
|
2023-05-20 02:30:24 +08:00
|
|
|
|
|
|
|
export interface GetChatDataResponse {
|
|
|
|
chat: Array<chatContent>;
|
2023-07-08 04:46:36 +08:00
|
|
|
}
|
2023-05-20 02:30:24 +08:00
|
|
|
|
|
|
|
export const GET_CHAT_DATA = gql`
|
2023-07-08 04:46:36 +08:00
|
|
|
query GetChatData($chatId: String!) {
|
|
|
|
chat(where: { chatId: { _eq: $chatId } }) {
|
|
|
|
chatId
|
|
|
|
public
|
|
|
|
participant {
|
|
|
|
name
|
|
|
|
}
|
2023-05-20 02:30:24 +08:00
|
|
|
}
|
|
|
|
}
|
2023-07-08 04:46:36 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const CLOSE_PRIVATE_CHAT_MUTATION = gql`
|
|
|
|
mutation UpdateChatUser($chatId: String) {
|
|
|
|
update_chat_user(where: { chatId: { _eq: $chatId } }, _set: { visible: false }) {
|
|
|
|
affected_rows
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|