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

View File

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