chore(legacy): relocate v1 dataconnect source
This commit is contained in:
69
legacy/dataconnect-v1/connector/conversation/mutations.gql
Normal file
69
legacy/dataconnect-v1/connector/conversation/mutations.gql
Normal file
@@ -0,0 +1,69 @@
|
||||
|
||||
mutation createConversation(
|
||||
$subject: String
|
||||
$status: ConversationStatus
|
||||
$conversationType: ConversationType
|
||||
$isGroup: Boolean
|
||||
$groupName: String
|
||||
$lastMessage: String
|
||||
$lastMessageAt: Timestamp
|
||||
) @auth(level: USER) {
|
||||
conversation_insert(
|
||||
data: {
|
||||
subject: $subject
|
||||
status: $status
|
||||
conversationType: $conversationType
|
||||
isGroup: $isGroup
|
||||
groupName: $groupName
|
||||
lastMessage: $lastMessage
|
||||
lastMessageAt: $lastMessageAt
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation updateConversation(
|
||||
$id: UUID!
|
||||
|
||||
$subject: String
|
||||
$status: ConversationStatus
|
||||
$conversationType: ConversationType
|
||||
$isGroup: Boolean
|
||||
$groupName: String
|
||||
$lastMessage: String
|
||||
$lastMessageAt: Timestamp
|
||||
|
||||
) @auth(level: USER) {
|
||||
conversation_update(
|
||||
id: $id
|
||||
data: {
|
||||
subject: $subject
|
||||
status: $status
|
||||
conversationType: $conversationType
|
||||
isGroup: $isGroup
|
||||
groupName: $groupName
|
||||
lastMessage: $lastMessage
|
||||
lastMessageAt: $lastMessageAt
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# UPDATE LAST MESSAGE
|
||||
# ----------------------------------------------------------
|
||||
mutation updateConversationLastMessage(
|
||||
$id: UUID!
|
||||
$lastMessage: String
|
||||
$lastMessageAt: Timestamp
|
||||
) @auth(level: USER) {
|
||||
conversation_update(
|
||||
id: $id
|
||||
data: {
|
||||
lastMessage: $lastMessage
|
||||
lastMessageAt: $lastMessageAt
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutation deleteConversation($id: UUID!) @auth(level: USER) {
|
||||
conversation_delete(id: $id)
|
||||
}
|
||||
125
legacy/dataconnect-v1/connector/conversation/queries.gql
Normal file
125
legacy/dataconnect-v1/connector/conversation/queries.gql
Normal file
@@ -0,0 +1,125 @@
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# LIST ALL (admin/debug)
|
||||
# ----------------------------------------------------------
|
||||
query listConversations(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
conversations(offset: $offset, limit: $limit, orderBy: { updatedAt: DESC }) {
|
||||
id
|
||||
subject
|
||||
status
|
||||
conversationType
|
||||
isGroup
|
||||
groupName
|
||||
lastMessage
|
||||
lastMessageAt
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# GET BY ID
|
||||
# ----------------------------------------------------------
|
||||
query getConversationById($id: UUID!) @auth(level: USER) {
|
||||
conversation(id: $id) {
|
||||
id
|
||||
subject
|
||||
status
|
||||
conversationType
|
||||
isGroup
|
||||
groupName
|
||||
lastMessage
|
||||
lastMessageAt
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# LIST BY TYPE (CLIENT_VENDOR / GROUP_STAFF)
|
||||
# ----------------------------------------------------------
|
||||
query listConversationsByType(
|
||||
$conversationType: ConversationType!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
conversations(
|
||||
where: { conversationType: { eq: $conversationType } }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { lastMessageAt: DESC }
|
||||
) {
|
||||
id
|
||||
subject
|
||||
status
|
||||
conversationType
|
||||
isGroup
|
||||
groupName
|
||||
lastMessage
|
||||
lastMessageAt
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# LIST BY STATUS (ACTIVE)
|
||||
# ----------------------------------------------------------
|
||||
query listConversationsByStatus(
|
||||
$status: ConversationStatus!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
conversations(
|
||||
where: { status: { eq: $status } }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { lastMessageAt: DESC }
|
||||
) {
|
||||
id
|
||||
subject
|
||||
status
|
||||
conversationType
|
||||
isGroup
|
||||
groupName
|
||||
lastMessage
|
||||
lastMessageAt
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# FILTER (dashboard/debug)
|
||||
# Supports searching by multiple optional fields
|
||||
# ----------------------------------------------------------
|
||||
query filterConversations(
|
||||
$status: ConversationStatus
|
||||
$conversationType: ConversationType
|
||||
$isGroup: Boolean
|
||||
$lastMessageAfter: Timestamp
|
||||
$lastMessageBefore: Timestamp
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) @auth(level: USER) {
|
||||
conversations(
|
||||
where: {
|
||||
status: { eq: $status }
|
||||
conversationType: { eq: $conversationType }
|
||||
isGroup: { eq: $isGroup }
|
||||
lastMessageAt: { ge: $lastMessageAfter, le: $lastMessageBefore }
|
||||
}
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
orderBy: { lastMessageAt: DESC }
|
||||
) {
|
||||
id
|
||||
subject
|
||||
status
|
||||
conversationType
|
||||
isGroup
|
||||
groupName
|
||||
lastMessage
|
||||
lastMessageAt
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user