-
Notifications
You must be signed in to change notification settings - Fork 7
API GraphQL Query 명세서
Minkwan-Song edited this page Nov 24, 2020
·
1 revision
{
allUsers {
id
nickname
avatar
password
lang
rooms {
id
avatar
code
}
messages {
id
text
source
}
}
}
mutation {
deleteUser($id: Int!) {
deleteUser(id: $id) // true
}
}
// example
mutation {
deleteUser(id: 13)
}
{
allRooms {
id
avatar
code
users {
id
nickname
avatar
lang
}
messages {
id
text
source
}
}
}
{
seeRoomById(id: 1) {
id
avatar
code
users {
id
nickname
avatar
lang
}
messages {
id
text
source
}
}
}
mutation {
createRoom(nickname: String!, avatar: String!, password: String, lang: String!) {
createRoom(nickname: $nickname, avatar: $testAvatar, password: $password, lang: $lang)
}
}
// example
mutation {
createRoom(nickname: "yejin", avatar: "avatar", lang: "en") {
id
code
}
}
mutation {
enterRoom(nickname: String!, avatar: String!, password: String, lang: String!, code: String!) {
enterRoom(nickname: $nickname, avatar: $testAvatar, password: $password, lang: $lang, code: $code)
}
}
// example
mutation {
enterRoom(nickname: "test5", avatar: "hi_avatar", lang: "ko", code: "335976")
}
mutation {
createMessage($text: String! $source: String!, $nickname: String!, $roomId: Int!) {
createMessage(text: $text, source: $source, nickname: $nickname, roomId: $roomId)
}
}
// example
mutation {
createMessage(text: "hi", source: "ko", nickname: "yejin", roomId: 1)
}
{
allChatById(id: 1) {
id
text
source
user {
id
nickname
avatar
lang
}
}
}
subscription {
newMessage {
id
text
source
}
}