BOD-14 Functional 2 way messaging from app.
This commit is contained in:
@@ -9,7 +9,9 @@ const errorLink = onError(
|
||||
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
|
||||
)
|
||||
);
|
||||
if (networkError) console.log(`[Network error]: ${networkError}`);
|
||||
if (networkError)
|
||||
console.log(`[Network error]: ${JSON.stringify(networkError)}`);
|
||||
console.log(operation.getContext());
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
15
client/src/graphql/conversations.queries.js
Normal file
15
client/src/graphql/conversations.queries.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { gql } from "apollo-boost";
|
||||
|
||||
export const CONVERSATION_LIST_SUBSCRIPTION = gql`
|
||||
subscription CONVERSATION_LIST_SUBSCRIPTION {
|
||||
conversations {
|
||||
phone_num
|
||||
id
|
||||
messages_aggregate(where: { read: { _eq: false } }) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
13
client/src/graphql/messages.queries.js
Normal file
13
client/src/graphql/messages.queries.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { gql } from "apollo-boost";
|
||||
|
||||
export const MESSAGES_SUBSCRIPTION = gql`
|
||||
subscription MESSAGES_SUBSCRIPTION($conversationId: uuid!) {
|
||||
messages(where: { conversationid: { _eq: $conversationId } }) {
|
||||
text
|
||||
created_at
|
||||
id
|
||||
status
|
||||
isoutbound
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user