Getting All Rooms
query{
allRooms{
edges{
node{
... fields ...
players{
... fields ...
}
}
}
}
}
Getting a Room with Room ID
query{
room(id: <int: room key>){
room{
... fields ...
}
}
}
Updating a Room
mutation{
updateRoom(input: {
id: <string: room id>
... fields to change ...
}){
room{
... fields ...
}
}
}
Deleting a Room
query{
deleteRoom(input: {
id: <string: room id>
}){
room{
... fields ...
}
}
}
Restarting a Room
query{
restartRoom(input: {
key: <int: room key>
}){
room{
... fields ...
}
}
}
Getting All Players
query{
allPlayers{
edges{
node{
... fields ...
}
}
}
}
Getting a Player with Player ID
query{
player(id:<string: player id>){
player{
... fields ...
}
}
}
Updating a Player
mutation{
updatePlayer(input: {
id: <string: player id>
... fields to change ...
}){
player{
... fields ...
}
}
}
Deleting a Player
query{
deletePlayer(input: {
id: <string: player id>
}){
player{
... fields ...
}
}
}
Player Creating a Room
# All fields in input are optional
mutation{
createRoom(input: {
playerCap: <int>
state: <int: 1=waiting, 2=running, 3=rejoining>
swapping: <bool>
maxIdleTime: <int>
}){
room{
... fields ...
}
}
}
Player Starting a Room with Room Key (Automatically Creates the Player)
mutation{
startRoom(input:{
roomKey:<int: corresponding to room key>
}){
room{
... fields ...
}
}
}
Player Joining a Room with Room Key (Automatically Creates the Player)
mutation{
joinRoom(input:{
roomKey:<int: corresponding to room key>
}){
player{
... fields ...
}
}
}
Player Starting Swap Card
mutation{
swapStart(input:{
id:<string: player id>
numCards: <int>
}){
player{
... fields ...
}
}
}
Player Ending Swap Card
mutation{
swapStart(input:{
id:<string: player id>
hand: <array[int]: card ids>
}){
player{
... fields ...
}
}
}
Player Reveal Card (Put Card then Get Card)
mutation{
revealCard(input:{
id:<string: player id>
hand: <array[int]: card ids>
}){
player{
... fields ...
}
}
}
Getting All Cards
query{
allCards{
edges{
node{
... fields ...
}
}
}
}
Getting a Card with Card ID
query{
card(id:<string: card id>){
card{
... fields ...
}
}
}
Updating a Card
mutation{
updateCard(input: {
id: <string: card id>
... fields to change ...
}){
card{
... fields ...
}
}
}
Deleting a Card
query{
deleteCard(input: {
id: <string: card id>
}){
card{
... fields ...
}
}
}