chore(legacy): relocate v1 dataconnect source
This commit is contained in:
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