Skip to content

Commit

Permalink
docs changes and a method to grab a stat by its name
Browse files Browse the repository at this point in the history
  • Loading branch information
kezz committed May 10, 2024
1 parent ea44974 commit effca6e
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ type Statistics {
): StatisticValueResult
@deprecated(reason: "This value is not backed by a rotation and will be removed. Use `rotationValue` instead.")

"Returns the value stored for the given statistic in a rotation."
"""
Returns the value stored for the given statistic in a rotation.
The returned number will be `null` if the statistic does not track in the provided rotation, or if the statistic doesn't exist.
"""
rotationValue(

Check notice on line 254 in schema.graphqls

View workflow job for this annotation

GitHub Actions / GraphQL Inspector

Field 'rotationValue' was added to object type 'Statistics'

Field 'rotationValue' was added to object type 'Statistics'
statisticKey: String!
@spectaql(options: [{ key: "example", value: "games_played" }]),
Expand All @@ -263,14 +267,18 @@ type Statistic {
"If this statistic generates leaderboards."
forLeaderboard: Boolean!

"The rotations for which this statistic is tracked."
"""
The rotations for which this statistic is tracked.
These are the rotations that can be used to generate leaderboards or fetch rotation values.
Note that the `YEARLY` rotation never generates leaderboards, even if it is returned in this list.
"""
rotations: [Rotation!]!

Check notice on line 276 in schema.graphqls

View workflow job for this annotation

GitHub Actions / GraphQL Inspector

Field 'rotations' was added to object type 'Statistic'

Field 'rotations' was added to object type 'Statistic'

"""
Returns the leaderboard for this statistic in a given rotation.
If this statistic does not generate leaderboards, or the statistic is not tracked for the provided rotation, this will return `null`.
Additionally, the amount is capped at 20.
"""
leaderboard(

Check notice on line 283 in schema.graphqls

View workflow job for this annotation

GitHub Actions / GraphQL Inspector

Field 'leaderboard' was added to object type 'Statistic'

Field 'leaderboard' was added to object type 'Statistic'
rotation: Rotation! = LIFETIME,
Expand All @@ -284,6 +292,7 @@ type LeaderboardEntry {
The player who has this entry.
This will be `null` if the player does not have the statistics enabled for the API.
However, for Crown Level or Trophy count leaderboards, the player will not be `null`.
"""
player: Player

Expand Down Expand Up @@ -344,6 +353,12 @@ type Query {
"Returns a list of all known statistics."
statistics: [Statistic!]!

"Returns a statistic by it's name."
statistic(

Check notice on line 357 in schema.graphqls

View workflow job for this annotation

GitHub Actions / GraphQL Inspector

Field 'statistic' was added to object type 'Query'

Field 'statistic' was added to object type 'Query'
key: String!
@spectaql(options: [{ key: "example", value: "games_played" }])
): Statistic

"""
Returns when this rotation will next rotate.
Expand All @@ -356,7 +371,7 @@ type Query {
If the rotation is due the exact time this method is called, this method will return the current time.
"""
lastRotation(rotation: Rotation!): DateTime!
previousRotation(rotation: Rotation!): DateTime!

Check notice on line 374 in schema.graphqls

View workflow job for this annotation

GitHub Actions / GraphQL Inspector

Field 'previousRotation' was added to object type 'Query'

Field 'previousRotation' was added to object type 'Query'
}

"Internal directive used to generate some documentation elements."
Expand Down

0 comments on commit effca6e

Please sign in to comment.