BOD-14 More refactoring for messaging. Styles removed.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user