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`
|
2024-07-05 04:00:06 +08:00
|
|
|
mutation UpdateChatVisible($chatId: String, $visible: Boolean) {
|
|
|
|
chatSetVisible(
|
|
|
|
chatId: $chatId
|
|
|
|
visible: $visible
|
|
|
|
)
|
2023-07-08 04:46:36 +08:00
|
|
|
}
|
|
|
|
`;
|