Poker Subs GraphQL API Reference
This is a documentation for poker subs services ecosystem.
Terms of Service
API Endpoints
# Production:
http://localhost:3000/api/v0/graphql
Queries
getGameStatistics
Description
Retrieve various game-related statistical data
Response
Returns a GameStatistics!
Example
Query
query GetGameStatistics {
getGameStatistics {
averageStackAtCents
totalActiveTables
averagePlayersPerTable
totalOnlinePlayers
averageBalanceOfOfflinePlayers
mostPopularGameType
}
}
Response
{
"data": {
"getGameStatistics": {
"averageStackAtCents": 987.65,
"totalActiveTables": 123,
"averagePlayersPerTable": 987.65,
"totalOnlinePlayers": 123,
"averageBalanceOfOfflinePlayers": 987.65,
"mostPopularGameType": "NLH"
}
}
}
getGames
Description
A query to retrieve an array of Game objects. The optional playerId argument can filter games related to a particular player.
Example
Query
query GetGames($playerId: String) {
getGames(playerId: $playerId) {
gameType
bbInCents
anteInCents
organizationId
size
seats {
playerId
stackAtCents
cards
}
}
}
Variables
{"playerId": "xyz789"}
Response
{
"data": {
"getGames": [
{
"gameType": "NLH",
"bbInCents": 987,
"anteInCents": 123,
"organizationId": "4",
"size": 987,
"seats": [Seat]
}
]
}
}
getPlayer
Description
Retrieve the details of a player based on their unique identifier.
Arguments:
- playerId: The unique identifier associated with a player.
Returns the Player type containing details like name and balance.
Example
Query
query GetPlayer($playerId: String!) {
getPlayer(playerId: $playerId) {
playerId
name
balanceAtCents
}
}
Variables
{"playerId": "abc123"}
Response
{
"data": {
"getPlayer": {
"playerId": "abc123",
"name": "abc123",
"balanceAtCents": 987
}
}
}
root
Description
A simple root query
Response
Returns a String
Example
Query
query Root {
root
}
Response
{"data": {"root": "xyz789"}}
Mutations
publishUpdateBB1
Description
Returns a Boolean indicating the success or failure of the operation.
Response
Returns a Boolean
Example
Query
mutation PublishUpdateBB1 {
publishUpdateBB1
}
Response
{"data": {"publishUpdateBB1": true}}
updateTotalOnlinePlayers
Description
Update the total number of players currently online. Arguments:
- newTotalOnlinePlayers: The new total of online players to be set.
Returns true if the update was successful.
Example
Query
mutation UpdateTotalOnlinePlayers($newTotalOnlinePlayers: Int!) {
updateTotalOnlinePlayers(newTotalOnlinePlayers: $newTotalOnlinePlayers)
}
Variables
{"newTotalOnlinePlayers": 123}
Response
{"data": {"updateTotalOnlinePlayers": true}}
Subscriptions
freeTable
Description
Allows clients to subscribe to updates about available free tables, receiving data whenever a new table fitting the criteria becomes available.
Response
Returns [FreeTable]!
Example
Query
subscription FreeTable {
freeTable {
gameType
bbInCents
anteInCents
organizationId
size
}
}
Response
{
"data": {
"freeTable": [
{
"gameType": "NLH",
"bbInCents": 123,
"anteInCents": 987,
"organizationId": "xyz789",
"size": 987
}
]
}
}
inGamePlayer
Description
Allows clients to subscribe to player updates, receiving new data whenever the in-game player details change and match the provided filter criteria.
Response
Returns an InGamePlayer
Arguments
Name | Description |
---|---|
filter - InGamePlayerFilterInput
|
Example
Query
subscription InGamePlayer($filter: InGamePlayerFilterInput) {
inGamePlayer(filter: $filter) {
playerId
name
totalOnlineTables
organizations {
id
inGameTables
}
}
}
Variables
{"filter": InGamePlayerFilterInput}
Response
{
"data": {
"inGamePlayer": {
"playerId": "abc123",
"name": "xyz789",
"totalOnlineTables": 123,
"organizations": [Organization]
}
}
}
occupiedTable
Description
A subscription that allows the client to receive real-time updates regarding tables that are currently occupied. Each update provides an array of OccupiedTable objects, reflecting the current state of the tables in the application.
Response
Returns [OccupiedTable]!
Example
Query
subscription OccupiedTable {
occupiedTable {
gameType
bbAtCents
anteAtCents
organizationId
size
occupiedSeatsCount
}
}
Response
{
"data": {
"occupiedTable": [
{
"gameType": "NLH",
"bbAtCents": 123,
"anteAtCents": 123,
"organizationId": "abc123",
"size": 123,
"occupiedSeatsCount": 987
}
]
}
}
offlinePlayer
Description
Provides the functionality to subscribe to offline player events and retrieve offline player data in real-time.
Arguments:
- filter: The criteria (OfflinePlayerFilterInput) used to filter and retrieve specific offline player data.
Returns real-time updates for the offline player that matches the specified filter criteria.
Response
Returns an OfflinePlayer
Arguments
Name | Description |
---|---|
filter - OfflinePlayerFilterInput
|
Example
Query
subscription OfflinePlayer($filter: OfflinePlayerFilterInput) {
offlinePlayer(filter: $filter) {
playerId
name
balanceAtCents
}
}
Variables
{"filter": OfflinePlayerFilterInput}
Response
{
"data": {
"offlinePlayer": {
"playerId": "abc123",
"name": "abc123",
"balanceAtCents": 123
}
}
}
Types
Boolean
Description
The Boolean
scalar type represents true
or false
.
Float
Description
The Float
scalar type represents signed double-precision fractional values as specified by IEEE 754.
Example
123.45
FreeTable
Description
Represents a table that is available for play but currently not occupied.
Fields
Field Name | Description |
---|---|
gameType - GameType!
|
The type of poker game to be played on this table, whether No Limit Hold'em (NLH) or Pot Limit Omaha (PLO). |
bbInCents - Int!
|
Specifies the value, in cents, that is considered as the 'big blind' for a hand at this table. |
anteInCents - Int
|
If applicable, defines the ante value in cents for a hand at this table. Some game variants or table setups might not require an ante, hence this field can be null. |
organizationId - String!
|
A unique string identifier assigned to the organization (such as a casino or online platform) that hosts this table. |
size - Int!
|
Defines the maximum number of players/seats that the table can accommodate. |
Example
{
"gameType": "NLH",
"bbInCents": 987,
"anteInCents": 123,
"organizationId": "abc123",
"size": 987
}
Game
Description
A comprehensive type representing the state and configuration of an individual poker game.
Fields
Field Name | Description |
---|---|
gameType - GameType!
|
Determines the variant of the poker game, chosen from defined game types. |
bbInCents - Int!
|
Specifies the value that is considered the 'big blind' for this game, in cents. |
anteInCents - Int
|
If applicable, defines the ante value in cents for this game. Can be null if the game type or rules do not require an ante. |
organizationId - ID!
|
A unique identifier for the organization (e.g., a casino or online platform) that is hosting this game. |
size - Int!
|
The number of seats at the table, indicating the maximum number of players that can participate in this game. |
seats - [Seat!]!
|
An array of Seat objects representing the players currently seated at the table and their respective game states. |
Example
{
"gameType": "NLH",
"bbInCents": 123,
"anteInCents": 987,
"organizationId": "4",
"size": 123,
"seats": [Seat]
}
GameStatistics
Description
Type providing various statistical data related to the games and players.
Fields
Field Name | Description |
---|---|
averageStackAtCents - Float!
|
The average stack size of players, in cents |
totalActiveTables - Int!
|
The total number of active tables |
averagePlayersPerTable - Float!
|
The average number of players per table |
totalOnlinePlayers - Int!
|
The total number of players currently online |
averageBalanceOfOfflinePlayers - Float!
|
The average balance of offline players, in cents |
mostPopularGameType - GameType!
|
The most popular type of poker game being played |
Example
{
"averageStackAtCents": 987.65,
"totalActiveTables": 123,
"averagePlayersPerTable": 987.65,
"totalOnlinePlayers": 123,
"averageBalanceOfOfflinePlayers": 987.65,
"mostPopularGameType": "NLH"
}
GameType
Description
Enum representing the available game types.
Values
Enum Value | Description |
---|---|
|
NLH: Represents No Limit Hold'em Poker |
|
PLO: Represents Pot Limit Omaha Poker |
Example
"NLH"
ID
Description
The ID
scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4"
) or integer (such as 4
) input value will be accepted as an ID.
Example
4
InGamePlayer
Description
Details about a player that is currently participating in an online game.
Fields
Field Name | Description |
---|---|
playerId - String!
|
Unique identifier used to reference a player. |
name - String!
|
Name or alias chosen or given to the player. |
totalOnlineTables - Int!
|
Total number of online poker tables the player is currently involved in. |
organizations - [Organization!]!
|
List of organizations that the player is related to or engaged with. |
Example
{
"playerId": "xyz789",
"name": "abc123",
"totalOnlineTables": 987,
"organizations": [Organization]
}
InGamePlayerFilterInput
Description
Encapsulates the parameters to be used to filter results when querying for in-game players.
Fields
Input Field | Description |
---|---|
playerId - String
|
If specified, filters results to include only the player with this unique identifier. |
name - String
|
If specified, filters results to include only players with this name. |
totalOnlineTables - Int
|
If specified, filters results to include only players engaged in this exact number of online games. |
organizations - [String!]
|
If specified, filters results to include only players associated with the specified organization IDs. |
Example
{
"playerId": "xyz789",
"name": "abc123",
"totalOnlineTables": 987,
"organizations": ["abc123"]
}
Int
Description
The Int
scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
Example
123
OccupiedTable
Description
Type representing a table that is currently occupied, with various attributes specifying the gameplay and organizational details.
Fields
Field Name | Description |
---|---|
gameType - GameType!
|
The type of poker game being played on this table. Possible values are NLH (No Limit Hold'em) or PLO (Pot Limit Omaha). |
bbAtCents - Int!
|
The amount (in cents) that is designated as the big blind (bb) for this table. This value dictates the minimum bet or raise in certain betting rounds. |
anteAtCents - Int
|
The amount (in cents) determined as the ante for this table. This is an optional field, as not all games/table configurations may require an ante. If present, the ante is a forced bet that all players must post before the start of a hand. |
organizationId - String!
|
A unique identifier for the organization that is hosting or responsible for this table. This could be utilized to retrieve further details about the organization from other parts of the API. |
size - Int!
|
Indicates the total number of seats available at this table. This number remains constant and is defined by the table's configuration. |
occupiedSeatsCount - Int!
|
Denotes the number of seats that are currently occupied by players at this table. This number can vary between 0 and the total size of the table. |
Example
{
"gameType": "NLH",
"bbAtCents": 987,
"anteAtCents": 123,
"organizationId": "xyz789",
"size": 123,
"occupiedSeatsCount": 123
}
OfflinePlayer
Description
Represents a player who is currently offline with relevant attributes.
Example
{
"playerId": "abc123",
"name": "xyz789",
"balanceAtCents": 987
}
OfflinePlayerFilterInput
Description
Input type to filter offline players based on specific criteria.
Fields
Input Field | Description |
---|---|
playerId - String
|
The unique identifier of the player. Useful for retrieving specific player details. |
name - String
|
The name of the player. Useful for searching and retrieving players by their names. |
balanceAtCents - Int
|
The balance of the player in cents. Useful for filtering players based on their balance thresholds. |
Example
{
"playerId": "xyz789",
"name": "abc123",
"balanceAtCents": 987
}
Organization
Description
Represents an entity, typically a company or group, that hosts poker games.
Example
{"id": "abc123", "inGameTables": 987}
Player
Description
Represents a player in the system with associated attributes.
Example
{
"playerId": "abc123",
"name": "xyz789",
"balanceAtCents": 123
}
Seat
Description
Represents a player's seating arrangement and current state in a game.
Fields
Field Name | Description |
---|---|
playerId - ID!
|
A unique identifier, assigned to players to track their game state and balances. |
stackAtCents - Int!
|
Represents the current amount of currency, in cents, that the player has available to wager. |
cards - [String!]!
|
An array representing the player’s cards, utilizing a standard card notation (i.e., ['AS', '2D'] for Ace of Spades and Two of Diamonds). |
Example
{
"playerId": 4,
"stackAtCents": 987,
"cards": ["abc123"]
}
String
Description
The String
scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
Example
"abc123"