Week 5 API Additions

Week 5 API Additions

Earlier today we deployed another set of features to prod. Most notably, stats, standings, and depth charts! Here's the changelog.

New Stats

  • PlayStatType has new enum values: OPPONENT_FUMBLE_RECOVERY_YARDS_WITHOUT_RECOVERY, OPPONENT_FUMBLE_RECOVERY_YARDS_FOR_TOUCHDOWN_WITHOUT_RECOVERY, OWN_FUMBLE_RECOVERY_YARDS_FOR_TOUCHDOWN, MISCELLANEOUS_YARDS, OPPONENT_FUMBLE_RECOVERY_YARDS_FOR_TOUCHDOWN, MISCELLANEOUS_YARDS_FOR_TOUCHDOWN, OWN_FUMBLE_RECOVERY_YARDS_FOR_TOUCHDOWN_WITHOUT_RECOVERY, OWN_FUMBLE_RECOVERY_YARDS_WITHOUT_RECOVERY

These are new low level stat types that we're exposing. Most of these have never been credited to anyone at the AAF.

  • AggregatedTeamStats has new fields: fieldGoalsAttempted, fieldGoalsBlocked, fieldGoalsMade, safeties, touchdowns
  • TeamStats has new fields: fieldGoalsAttempted, fieldGoalsBlocked, fieldGoalsMade, safeties, touchdowns
  • PlayerStats has new fields: sackYardsLost

These provide new high level ways to get existing / more common stats.

Standings

  • TeamSeasonEdge has new fields: standing
  • TeamStanding has been added.

You can now get official team standings via the API. This also provides the components used to calculate them. For example, you can run a query like so to get the current standings for all of the teams:

{
  teamsConnection {
    nodes {
      name
      seasonsConnection(last: 1) {
        edges {
          standing {
            rank
            divisionRank
            wins
            losses
            divisionWins
            divisionLosses
            pointsAllowed
            points
            divisionPointsAllowed
            divisionPoints
            ties
            divisionTies
            touchdowns
            touchdownsAllowed
          }
        }
      }
    }
  }
}

Our website has had standings displayed for a while, but at the time of writing uses a rudimentary ranking method and doesn't implement logic for tiebreaking. The API implements our official tiebreaking logic, and the website will soon use this API to display accurate rankings.

Depth Charts

  • DepthChartFormationPlayerEdge has been added.
  • DepthChartFormationPlayersConnection has been added.
  • DepthChartFormation has been added.
  • DepthChart has been added.
  • GameTeamEdge has new fields: depthChart

You can now get the official depth chart for each game via this API. For example:

{
  node(id: "GjpS3aP6Dt9bGBss_syEjZmtUt64") {
    ... on Game {
      homeTeamEdge {
        node {
          name
        }
        depthChart(platoon: OFFENSE) {
          formations {
            name
            playersConnection {
              edges {
                node {
                  name {
                    givenName
                    familyName
                  }
                }
                depth
              }
            }
          }
        }
      }
    }
  }
}

Other

  • Player has new fields: hometown

We'll be populating this field with player hometowns in the future.

Week 5 API Additions
Share this