feat: Integrate Data Connect and Implement Staff List View Directory
This commit is contained in:
37
backend/dataconnect/example/message/mutations.gql
Normal file
37
backend/dataconnect/example/message/mutations.gql
Normal file
@@ -0,0 +1,37 @@
|
||||
mutation createMessage(
|
||||
$conversationId: UUID!,
|
||||
$senderId: String!,
|
||||
$content: String!,
|
||||
$isSystem: Boolean
|
||||
) @auth(level: USER) {
|
||||
message_insert(
|
||||
data: {
|
||||
conversationId: $conversationId,
|
||||
senderId: $senderId,
|
||||
content: $content,
|
||||
isSystem: $isSystem
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateMessage(
|
||||
$id: UUID!,
|
||||
$conversationId: UUID,
|
||||
$senderId: String,
|
||||
$content: String,
|
||||
$isSystem: Boolean
|
||||
) @auth(level: USER) {
|
||||
message_update(
|
||||
id: $id,
|
||||
data: {
|
||||
conversationId: $conversationId,
|
||||
senderId: $senderId,
|
||||
content: $content,
|
||||
isSystem: $isSystem
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteMessage($id: UUID!) @auth(level: USER) {
|
||||
message_delete(id: $id)
|
||||
}
|
||||
41
backend/dataconnect/example/message/queries.gql
Normal file
41
backend/dataconnect/example/message/queries.gql
Normal file
@@ -0,0 +1,41 @@
|
||||
query listMessages @auth(level: USER) {
|
||||
messages {
|
||||
id
|
||||
conversationId
|
||||
senderId
|
||||
content
|
||||
isSystem
|
||||
createdAt
|
||||
user{
|
||||
fullName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query getMessageById($id: UUID!) @auth(level: USER) {
|
||||
message(id: $id) {
|
||||
id
|
||||
conversationId
|
||||
senderId
|
||||
content
|
||||
isSystem
|
||||
createdAt
|
||||
user{
|
||||
fullName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query getMessagesByConversationId($conversationId: UUID!) @auth(level: USER) {
|
||||
messages(where: { conversationId: { eq: $conversationId } }) {
|
||||
id
|
||||
conversationId
|
||||
senderId
|
||||
content
|
||||
isSystem
|
||||
createdAt
|
||||
user{
|
||||
fullName
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user