BOD-14 Added virtualization for messages with known bug. Added messages geting marked as read.
This commit is contained in:
@@ -19,7 +19,7 @@ export const CONVERSATION_LIST_SUBSCRIPTION = gql`
|
||||
export const CONVERSATION_SUBSCRIPTION_BY_PK = gql`
|
||||
subscription CONVERSATION_SUBSCRIPTION_BY_PK($conversationId: uuid!) {
|
||||
conversations_by_pk(id: $conversationId) {
|
||||
messages {
|
||||
messages(order_by: { created_at: asc_nulls_first }) {
|
||||
id
|
||||
status
|
||||
text
|
||||
|
||||
@@ -12,3 +12,18 @@ export const INSERT_CONVERSATION_TAG = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const REMOVE_CONVERSATION_TAG = gql`
|
||||
mutation REMOVE_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {
|
||||
delete_job_conversations(
|
||||
where: {
|
||||
_and: {
|
||||
jobid: { _eq: $jobId }
|
||||
conversationid: { _eq: $conversationId }
|
||||
}
|
||||
}
|
||||
) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
14
client/src/graphql/messages.queries.js
Normal file
14
client/src/graphql/messages.queries.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { gql } from "apollo-boost";
|
||||
|
||||
export const MARK_MESSAGES_AS_READ_BY_CONVERSATION = gql`
|
||||
mutation MARK_MESSAGES_AS_READ_BY_CONVERSATION($conversationId: uuid) {
|
||||
update_messages(
|
||||
where: { conversationid: { _eq: $conversationId } }
|
||||
_set: { read: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user