IO-1551 Refactor messaging.

This commit is contained in:
Patrick Fic
2021-12-08 12:38:26 -08:00
parent 26d22388c0
commit 1f7b53ee22
30 changed files with 614 additions and 302 deletions

View File

@@ -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 = `