BOD-14 More refactoring for messaging. Styles removed.

This commit is contained in:
Patrick Fic
2020-03-27 17:03:48 -07:00
parent c0be80b42e
commit 644737e1c3
9 changed files with 122 additions and 82 deletions

View File

@@ -5,7 +5,29 @@ export const CONVERSATION_LIST_SUBSCRIPTION = gql`
conversations {
phone_num
id
messages_aggregate(where: { read: { _eq: false } }) {
messages_aggregate(
where: { read: { _eq: false }, isoutbound: { _eq: false } }
) {
aggregate {
count
}
}
}
}
`;
export const CONVERSATION_SUBSCRIPTION_BY_PK = gql`
subscription CONVERSATION_SUBSCRIPTION_BY_PK($conversationId: uuid!) {
conversations_by_pk(id: $conversationId) {
messages {
id
status
text
isoutbound
}
messages_aggregate(
where: { read: { _eq: false }, isoutbound: { _eq: false } }
) {
aggregate {
count
}

View File

@@ -1,16 +0,0 @@
import { gql } from "apollo-boost";
export const MESSAGES_SUBSCRIPTION = gql`
subscription MESSAGES_SUBSCRIPTION($conversationId: uuid!) {
messages(
where: { conversationid: { _eq: $conversationId } }
order_by: { created_at: asc }
) {
text
created_at
id
status
isoutbound
}
}
`;