IO-1438 Resolve inbound conversation creation.

This commit is contained in:
Patrick Fic
2021-10-25 11:00:31 -07:00
parent 6e6f3d3d3e
commit 1a0054a911
2 changed files with 92 additions and 104 deletions

View File

@@ -20,6 +20,28 @@ mutation UNARCHIVE_CONVERSATION($id: uuid!) {
}
`;
exports.RECEIVE_MESSAGE = `
mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) {
insert_messages(objects: $msg) {
returning {
conversation {
id
archived
bodyshop {
associations(where: {active: {_eq: true}}) {
user {
fcmtokens
}
}
}
}
}
}
}
`;
exports.INSERT_MESSAGE = `
mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!) {
update_conversations_by_pk(pk_columns: {id: $conversationid}, _set: {archived: false}) {