Fetch athlete KPI data

AthleteKpv

The AthleteKpv object is primarily the access point for athlete athlete measurements for the given KPV.

It also contains the generic KPV-level info as well (e.g. name, unit, etc.). See institution.kpvs for information about KPV-level fields.

measurements(startDate: ISO 8601 String, endDate: ISO 8601 String) => [KpvMeasurement]

The measurements field returns an array of KpvMeasurement objects that were recorded for the athlete within the specified date range. It accepts two required arguments: a startDate string in ISO 8601 format ("YYYY-MM-DD") to specify the beginning of the desired date range, and an endDate string in ISO 8601 format to specify the end of the desired date range.

value => Float

The value field returns a float that represents the athlete's most recent (or "current") measurement for the give KPV. It will return 0 if no measurements exists.

KpvMeasurement

The KpvMeasurement object contains information about an athlete measurement for the given KPV on a specific date.

athleteEmail => String

The athleteEmail field returns the email of the athlete for whom the measurement was recorded.

date => ISO 8601 String

The date field returns the date that the measurement was recorded in ISO 8601 format ("YYYY-MM-DD").

value => Float

The value field returns the measurement's recorded numerical value as a float.

Sample Query

Example:

query {
  institution {
    athletes(athleteEmails: ["[email protected]"]) {
      email,
      kpvs(uuids: ["3c2dafb4-160d-4b67-be63-d2d6915310ec"]) {
        name,
        measurements(startDate: "2023-01-01", endDate: "2023-12-31") {
          date,
          value
        }
      }
    }
  }
}

Response:

{
  "data": {
    "institution": {
      "athletes": [
        {
          "email": "[email protected]",
          "kpvs": [
            {
              "name": "Soreness",
              "measurements": [
                {
                  "date": "2023-08-15",
                  "value": 3
                },
                {
                  "date": "2023-10-01",
                  "value": 8
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

⚠️

Avoid Request Timeouts

The amount of data requested can easily spiral out of control if you're not careful. To avoid request timeouts for very large amounts of data, we strongly advise that you limit the scope of each request to a subset of athletes and/or a relatively narrow date range (~30 days is probably the upper end of the recommended range depending on the number of athletes and the frequency of recorded measurements).