mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-17 18:31:20 +00:00
35 lines
515 B
TypeScript
35 lines
515 B
TypeScript
import gql from 'graphql-tag'
|
|
|
|
export const createMessageMutation = () => {
|
|
return gql`
|
|
mutation (
|
|
$roomId: ID!
|
|
$content: String!
|
|
) {
|
|
CreateMessage(
|
|
roomId: $roomId
|
|
content: $content
|
|
) {
|
|
id
|
|
content
|
|
}
|
|
}
|
|
`
|
|
}
|
|
|
|
export const messageQuery = () => {
|
|
return gql`
|
|
query($roomId: ID!) {
|
|
Message(roomId: $roomId) {
|
|
_id
|
|
id
|
|
content
|
|
senderId
|
|
username
|
|
avatar
|
|
date
|
|
}
|
|
}
|
|
`
|
|
}
|