athletes

Fetch athlete data

Athlete

athletes(emails:[String], uuids:[String]) => [Athlete]

The athletes entry point returns a list of athlete objects with the data points you requested. It accepts an optional emails or uuids argument that allows you to request data about specific athletes by providing an array of emails or UUIDs.

email => String

The email field returns the athlete's email address associated with their FYTT account.

metrics(uuids: [String]*) => [AthleteMetric]

The metrics field returns an array of athlete metric data objects with your requested fields. It accepts a required uuids argument, which should be an array of UUID strings that specifies which metrics you're requesting.

name => String

The name field returns the athlete's name (combined first and last names) as stored in their FYTT account.

workouts(startDate: ISO 8601 Date String*, endDate: ISO 8601 Date String*) => [Session]

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

This field can be used to retrieve workouts that were scheduled in the past, as well as workouts that are scheduled in the future. Past workouts may or may not contain recorded athlete data depending on whether or not the athlete actually started the workout and recorded data from within the UI.

uuid => String

The uuid field returns the UUID generated by FYTT for the athlete. This value can be used when querying or mutating athlete data.

* indicates required argument

Sample Query

Example:

query {
  athletes(uuids:["27d6f7e7-83cb-44a9-9406-389e8db16144"]) {
    name,
    uuid,
    metrics(uuids:["f43feed5-106b-4ffc-8889-84e35a576159"]) {
      measurements(startDate:"2024-07-01", endDate:"2024-12-31") {
        date,
        value
      }
    }
  }
}

Response:

{
  "data": {
    "athletes": [
      {
        "name": "Devin Anderson",
        "uuid": "27d6f7e7-83cb-44a9-9406-389e8db16144",
        "metrics": [
          {
            "measurements": [
              {
                "date": "2024-07-01",
                "value": 375
              },
              {
                "date": "2024-08-01",
                "value": 385
              },
              {
                "date": "2024-09-01",
                "value": 380
              },
              {
                "date": "2024-10-28",
                "value": 395
              },
              {
                "date": "2024-10-30",
                "value": 410
              }
            ]
          }
        ]
      }
    ]
  }
}

In addition to the base entry point, athletes can be fetched through several other entry points:

institution.athletes => Returns all athletes at the institution (same as base entry point)

query {
  institution {
		athletes(emails: ["[email protected]"]) {
      name,
      uuid
    }
  }
}

teams.athletes => Returns all athletes for the selected teams

query {
  teams(uuids: ["27d6f7e7-83cb-44a9-9406-389e8db16144"]) {
		athletes(emails: ["[email protected]"]) {
      name,
      uuid,
    }
  }
}

teams.groups.athletes => Returns all athletes for the selected groups

query {
  teams(uuids: ["27d6f7e7-83cb-44a9-9406-389e8db16144"]) {
		groups(uuids: ["fadc4bde-c3d6-42cd-a21b-7cb3aa507e88"]) {
			athletes(emails: ["[email protected]"]) {
        name,
        uuid,
      } 
    }
  }
}