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 # recreates the active game to a follow-up createFollowupGame: BingoGame # sends a message to the current sessions chat sendChatMessage(input: MessageInput!): ChatMessage } 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 } 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 # the id of the followup game if it has been created followup: ID # Returns the last n chat-messages getMessages(input: MessageQueryInput): [ChatMessage!] } 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 } type ChatMessage { # the id of the message id: ID! # the content of the message content: String! # the content of the message rendered by markdown-it htmlContent: String # the type of the message type: MessageType! # the username of the sender username: String # the time the message was send (in milliseconds) datetime: String! } # # # input Types # # # 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! } input MessageInput { # the message message: String! } input MessageQueryInput { # search for a specific id id: ID # get the last n messages last: Int = 10 } # # # enum Types # # # enum MessageType { USER ERROR INFO }