sdy

create ChatQueries.js

import { gql } from "apollo-boost";
export const SUBSCRIPTION_MSG = gql`
subscription subMessage {
subMessage {
id
text
sender {
id
username
}
createdAt
}
}
`;
export const NEW_MESSAGE = gql`
mutation newMessage($message: String) {
newMessage(message: $message) {
id
text
sender {
id
username
}
createdAt
}
}
`;