You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
whooshy/graphql/bingo.graphql

114 lines
2.0 KiB
GraphQL

type BingoMutation {
# creates a game of bingo and returns the game id
createGame(input: CreateGameInput!): BingoGame
# submit a bingo to the active game session
submitBingo: BingoGame
# toggle a word (heared or not) on the sessions grid
toggleWord(input: WordInput!): BingoGrid
# set the username of the current session
setUsername(input: UsernameInput): BingoUser
}
type BingoQuery {
# Returns the currently active bingo game
gameInfo(input: IdInput): BingoGame
# If there is a bingo in the fields.
checkBingo: Boolean
# Returns the grid of the active bingo game
activeGrid: BingoGrid
}
input CreateGameInput {
# the words used to fill the bingo grid
words: [String!]!
# the size of the bingo grid
size: Int! = 3
}
input WordInput {
# the normal word string
word: String
# the base64-encoded word
base64Word: String
}
input UsernameInput {
# the username string
username: String!
}
input IdInput {
# the id
id: ID!
}
type BingoGame {
# the id of the bingo game
id: ID!
# the words used in the bingo game
words: [String]!
# the size of the square-grid
gridSize: Int
# an array of players active in the bingo game
players(input: IdInput): [BingoUser]
# the player-ids that scored a bingo
bingos: [String]!
# if the game has already finished
finished: Boolean
}
type BingoUser {
# the id of the bingo user
id: ID!
# the id of the currently active bingo game
game: ID
# the name of the user
username: String
}
type BingoGrid {
# the grid represented as string matrix
wordGrid: [[String]]!
# the grid represented as bingo field matrix
fieldGrid: [[BingoField]]!
# if there is a bingo
bingo: Boolean
}
type BingoField {
# the word contained in the bingo field
word: String
# if the word was already heared
submitted: Boolean!
# the base64 encoded word
base64Word: String
}