Showing
1 changed file
with
29 additions
and
0 deletions
front/src/Routes/Chat/ChatQueries.js
0 → 100644
1 | +import { gql } from "apollo-boost"; | ||
2 | + | ||
3 | +export const SUBSCRIPTION_MSG = gql` | ||
4 | + subscription subMessage { | ||
5 | + subMessage { | ||
6 | + id | ||
7 | + text | ||
8 | + sender { | ||
9 | + id | ||
10 | + username | ||
11 | + } | ||
12 | + createdAt | ||
13 | + } | ||
14 | + } | ||
15 | +`; | ||
16 | + | ||
17 | +export const NEW_MESSAGE = gql` | ||
18 | + mutation newMessage($message: String) { | ||
19 | + newMessage(message: $message) { | ||
20 | + id | ||
21 | + text | ||
22 | + sender { | ||
23 | + id | ||
24 | + username | ||
25 | + } | ||
26 | + createdAt | ||
27 | + } | ||
28 | + } | ||
29 | +`; |
-
Please register or login to post a comment