Showing
1 changed file
with
23 additions
and
1 deletions
... | @@ -15,7 +15,7 @@ export const SUBSCRIPTION_MSG = gql` | ... | @@ -15,7 +15,7 @@ export const SUBSCRIPTION_MSG = gql` |
15 | `; | 15 | `; |
16 | 16 | ||
17 | export const NEW_MESSAGE = gql` | 17 | export const NEW_MESSAGE = gql` |
18 | - mutation newMessage($message: String) { | 18 | + mutation newMessage($message: String!) { |
19 | newMessage(message: $message) { | 19 | newMessage(message: $message) { |
20 | id | 20 | id |
21 | text | 21 | text |
... | @@ -27,3 +27,25 @@ export const NEW_MESSAGE = gql` | ... | @@ -27,3 +27,25 @@ export const NEW_MESSAGE = gql` |
27 | } | 27 | } |
28 | } | 28 | } |
29 | `; | 29 | `; |
30 | + | ||
31 | +export const WHOLE_MESSAGE = gql` | ||
32 | + mutation wholeMessage($message: String!, $roomId: Int!) { | ||
33 | + wholeMessage(message: $message, roomId: $roomId) { | ||
34 | + id | ||
35 | + text | ||
36 | + sender { | ||
37 | + id | ||
38 | + username | ||
39 | + } | ||
40 | + createdAt | ||
41 | + } | ||
42 | + } | ||
43 | +`; | ||
44 | + | ||
45 | +export const GET_ROOM_BY_NAME = gql` | ||
46 | + query getRoomByName($roomName: String!) { | ||
47 | + getRoomByName(roomName: $roomName) { | ||
48 | + id | ||
49 | + } | ||
50 | + } | ||
51 | +`; | ... | ... |
-
Please register or login to post a comment