IO-1551 Refactor messaging.
This commit is contained in:
@@ -22,48 +22,74 @@ mutation UNARCHIVE_CONVERSATION($id: uuid!) {
|
||||
|
||||
exports.RECEIVE_MESSAGE = `
|
||||
mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) {
|
||||
|
||||
insert_messages(objects: $msg) {
|
||||
insert_messages(objects: $msg) {
|
||||
returning {
|
||||
conversation {
|
||||
id
|
||||
archived
|
||||
bodyshop {
|
||||
associations(where: {active: {_eq: true}}) {
|
||||
user {
|
||||
fcmtokens
|
||||
}
|
||||
}
|
||||
bodyshop{
|
||||
imexshopid
|
||||
}
|
||||
created_at
|
||||
updated_at
|
||||
unreadcnt
|
||||
phone_num
|
||||
}
|
||||
conversationid
|
||||
created_at
|
||||
id
|
||||
image_path
|
||||
image
|
||||
isoutbound
|
||||
msid
|
||||
read
|
||||
text
|
||||
updated_at
|
||||
status
|
||||
userid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
`;
|
||||
|
||||
exports.INSERT_MESSAGE = `
|
||||
mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!) {
|
||||
update_conversations_by_pk(pk_columns: {id: $conversationid}, _set: {archived: false}) {
|
||||
id
|
||||
archived
|
||||
}
|
||||
insert_messages(objects: $msg) {
|
||||
insert_messages(objects: $msg) {
|
||||
returning {
|
||||
conversation {
|
||||
id
|
||||
archived
|
||||
bodyshop {
|
||||
associations(where: {active: {_eq: true}}) {
|
||||
user {
|
||||
fcmtokens
|
||||
}
|
||||
}
|
||||
bodyshop{
|
||||
imexshopid
|
||||
}
|
||||
created_at
|
||||
updated_at
|
||||
unreadcnt
|
||||
phone_num
|
||||
}
|
||||
conversationid
|
||||
created_at
|
||||
id
|
||||
image_path
|
||||
image
|
||||
isoutbound
|
||||
msid
|
||||
read
|
||||
text
|
||||
updated_at
|
||||
status
|
||||
userid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
`;
|
||||
|
||||
exports.UPDATE_MESSAGE_STATUS = `
|
||||
|
||||
Reference in New Issue
Block a user