Get Tournaments

GraphQL query:

query GetTournaments(
    $facilityId: ID!
    $list: TournamentListKinds! = LIVE_AND_UPCOMING,
    $take: Int = 200,
    $skip: Int = 0
    ) {
  node(id: $facilityId) {
    ... on Facility {
        id
        name
        tournaments {
            list (list: $list, take: $take, skip: $skip) {
                items {
                    id
                    name
                    type
                    backgroundImage
                    startDate
                    endDate
                }
            }
        }
    }
  }
}

Variables:

{
  "facilityId": "<Your FacilityId>"
}

Example of response:

{
    "data": {
        "node": {
            "id": "...",
            "name": "-- The Cave --",
            "tournaments": {
                "list": {
                    "items": [
                        {
                            "id": "...",
                            "name": "My Better Ball Team Gross Match",
                            "type": "COURSE_TOURNAMENT",
                            "backgroundImage": "https://cdn.trackmangolf.com/course-resources/senojavalley_Splash_7175cfd6-08f8-4c1e-be64-7167b3b185ab",
                            "startDate": "2023-10-03T03:30:00.000Z",
                            "endDate": "2023-11-26T03:59:00.000Z"
                        }
                    ]
                }
            }
        }
    }
}

Use the data.node.tournaments.list.items.id as Tournament Id for your leaderboard