Add runs leaderboard

This commit is contained in:
Ivan Malison 2024-12-22 15:00:19 -07:00
parent 2a36a392ce
commit a2e659dfcb
2 changed files with 49 additions and 11 deletions

View File

@ -124,7 +124,7 @@ export enum ClientUploadStatusEnum {
export type CountLeaderboardGql = {
__typename?: "CountLeaderboardGQL";
entries: Array<IntUserLeaderboardEntry>;
entries: Array<UserShotCountEntry>;
};
export type CreateBucketSetInput = {
@ -2014,12 +2014,6 @@ export type IntPoint2D = {
y: Scalars["Int"]["output"];
};
export type IntUserLeaderboardEntry = {
__typename?: "IntUserLeaderboardEntry";
user: UserGql;
value: Scalars["Int"]["output"];
};
export type MakePercentageIntervalGql = {
__typename?: "MakePercentageIntervalGQL";
elapsedTime: Scalars["Float"]["output"];
@ -2243,6 +2237,7 @@ export type Query = {
getDeployedConfig: DeployedConfigGql;
getFeedVideos: VideoHistoryGql;
getLoggedInUser?: Maybe<UserGql>;
getLongestRunsLeaderboard: RunLeaderboardGql;
getMakesLeaderboard: CountLeaderboardGql;
getMedals: RequestedMedalsGql;
getOrderedShots: GetShotsResult;
@ -2284,6 +2279,12 @@ export type QueryGetFeedVideosArgs = {
limit?: Scalars["Int"]["input"];
};
export type QueryGetLongestRunsLeaderboardArgs = {
interval?: InputMaybe<TimeInterval>;
requiredTags?: InputMaybe<Array<Scalars["String"]["input"]>>;
when?: InputMaybe<Scalars["DateTime"]["input"]>;
};
export type QueryGetMakesLeaderboardArgs = {
interval?: InputMaybe<TimeInterval>;
when?: InputMaybe<Scalars["DateTime"]["input"]>;
@ -2421,6 +2422,12 @@ export type RequestedMedalsGql = {
totalMakes10000?: Maybe<MedalGql>;
};
export type RunEntry = {
__typename?: "RunEntry";
run: RunGql;
user: UserGql;
};
export type RunFilterInput = {
andFilters?: InputMaybe<Array<RunFilterInput>>;
createdAt?: InputMaybe<DateRangeFilter>;
@ -2439,9 +2446,15 @@ export type RunGql = {
runLength: Scalars["Int"]["output"];
shots: Array<ShotGql>;
userId: Scalars["Int"]["output"];
video: VideoGql;
videoId: Scalars["Int"]["output"];
};
export type RunLeaderboardGql = {
__typename?: "RunLeaderboardGQL";
entries: Array<RunEntry>;
};
export type RunsOrderingComponent =
| { runLength: IntOrdering; videoCreation?: never; videoId?: never }
| { runLength?: never; videoCreation: DatetimeOrdering; videoId?: never }
@ -2734,6 +2747,14 @@ export type UserRelationshipsResult = {
relationships: Array<UserRelationship>;
};
export type UserShotCountEntry = {
__typename?: "UserShotCountEntry";
proportionMade: Scalars["Float"]["output"];
total: Scalars["Int"]["output"];
user: UserGql;
value: Scalars["Int"]["output"];
};
export type VideoFeedInputGql =
| {
allUsers: Scalars["Boolean"]["input"];
@ -3084,7 +3105,7 @@ export type GetMakesLeaderboardQuery = {
getMakesLeaderboard: {
__typename?: "CountLeaderboardGQL";
entries: Array<{
__typename?: "IntUserLeaderboardEntry";
__typename?: "UserShotCountEntry";
value: number;
user: {
__typename?: "UserGQL";

View File

@ -71,6 +71,11 @@ type Query {
filters: VideoFilterInput = null
feedInput: VideoFeedInputGQL = null
): VideoHistoryGQL!
getLongestRunsLeaderboard(
interval: TimeInterval = null
when: DateTime = null
requiredTags: [String!] = null
): RunLeaderboardGQL!
getMakesLeaderboard(
interval: TimeInterval = null
when: DateTime = null
@ -342,6 +347,7 @@ type RunGQL {
videoId: Int!
userId: Int!
shots: [ShotGQL!]!
video: VideoGQL!
}
type ShotGQL {
@ -723,13 +729,24 @@ input VideoFeedInputGQL @oneOf {
allUsers: Boolean
}
type CountLeaderboardGQL {
entries: [IntUserLeaderboardEntry!]!
type RunLeaderboardGQL {
entries: [RunEntry!]!
}
type IntUserLeaderboardEntry {
type RunEntry {
user: UserGQL!
run: RunGQL!
}
type CountLeaderboardGQL {
entries: [UserShotCountEntry!]!
}
type UserShotCountEntry {
user: UserGQL!
value: Int!
total: Int!
proportionMade: Float!
}
type Mutation {