List races in an event, including course definition and timing

Given an event key, lists every race with timing and course definition.

The course is the structure that makes leg-based analysis possible: without start line, marks, and finish defined, only single-leg metrics (overall distance, average speed) are meaningful. With a course defined, leg boundaries are derived from mark roundings rather than wind shifts, which is more robust when the wind shifts mid-race.

Query

query ListRacesForEvent($eventKey: ID!) {
  event(key: $eventKey) {
    key
    name
    races {
      key
      name
      startTime
      endTime
      course {
        elements {
          type
          name
          coord1 { lat lon }
          coord2 { lat lon }
        }
      }
    }
  }
}

Variables:

{ "eventKey": "Event_…" }

Filtering for analysable races

Many races don't have a course defined (training, casual practice). Filter client-side by course != null if the downstream analysis requires leg structure:

const analysable = data.event.races.filter(r => r.course != null);

Course element types

The elements array describes the race course in order. Common type values:

  • StartLine — paired coordinates (port pin, committee boat); coord1 / coord2 are the two ends.
  • Mark — single point (coord1); coord2 is null. Roundings detected from boat track proximity.
  • Gate — paired coordinates for a leeward or windward gate.
  • FinishLine — paired coordinates, same shape as StartLine.

Notes

  • startTime is the race start gun; endTime is the time the last analysed boat crossed the finish (not the published race-committee finish).
  • For races where the start line is reused as a gate (multi-lap course), the auto-detected endTime may be the first lap — extend manually in the Analytics UI before relying on it for full-race aggregates.