Merge pull request 'Leaderboards operation' (#153) from loewy/leaderboard-operations into master

Reviewed-on: #153
This commit is contained in:
loewy 2024-12-20 14:14:24 -07:00
commit 2a36a392ce
2 changed files with 115 additions and 0 deletions

View File

@ -3074,6 +3074,28 @@ export type GetVideoFeedQuery = {
}; };
}; };
export type GetMakesLeaderboardQueryVariables = Exact<{
interval?: InputMaybe<TimeInterval>;
when?: InputMaybe<Scalars["DateTime"]["input"]>;
}>;
export type GetMakesLeaderboardQuery = {
__typename?: "Query";
getMakesLeaderboard: {
__typename?: "CountLeaderboardGQL";
entries: Array<{
__typename?: "IntUserLeaderboardEntry";
value: number;
user: {
__typename?: "UserGQL";
id: number;
username: string;
profileImageUri?: string | null;
};
}>;
};
};
export type GetVideoMakePercentageIntervalsQueryVariables = Exact<{ export type GetVideoMakePercentageIntervalsQueryVariables = Exact<{
videoId: Scalars["ID"]["input"]; videoId: Scalars["ID"]["input"];
intervalDuration: Scalars["Int"]["input"]; intervalDuration: Scalars["Int"]["input"];
@ -5111,6 +5133,87 @@ export type GetVideoFeedQueryResult = Apollo.QueryResult<
GetVideoFeedQuery, GetVideoFeedQuery,
GetVideoFeedQueryVariables GetVideoFeedQueryVariables
>; >;
export const GetMakesLeaderboardDocument = gql`
query GetMakesLeaderboard($interval: TimeInterval, $when: DateTime) {
getMakesLeaderboard(interval: $interval, when: $when) {
entries {
user {
id
username
profileImageUri
}
value
}
}
}
`;
/**
* __useGetMakesLeaderboardQuery__
*
* To run a query within a React component, call `useGetMakesLeaderboardQuery` and pass it any options that fit your needs.
* When your component renders, `useGetMakesLeaderboardQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetMakesLeaderboardQuery({
* variables: {
* interval: // value for 'interval'
* when: // value for 'when'
* },
* });
*/
export function useGetMakesLeaderboardQuery(
baseOptions?: Apollo.QueryHookOptions<
GetMakesLeaderboardQuery,
GetMakesLeaderboardQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetMakesLeaderboardQuery,
GetMakesLeaderboardQueryVariables
>(GetMakesLeaderboardDocument, options);
}
export function useGetMakesLeaderboardLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetMakesLeaderboardQuery,
GetMakesLeaderboardQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetMakesLeaderboardQuery,
GetMakesLeaderboardQueryVariables
>(GetMakesLeaderboardDocument, options);
}
export function useGetMakesLeaderboardSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetMakesLeaderboardQuery,
GetMakesLeaderboardQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetMakesLeaderboardQuery,
GetMakesLeaderboardQueryVariables
>(GetMakesLeaderboardDocument, options);
}
export type GetMakesLeaderboardQueryHookResult = ReturnType<
typeof useGetMakesLeaderboardQuery
>;
export type GetMakesLeaderboardLazyQueryHookResult = ReturnType<
typeof useGetMakesLeaderboardLazyQuery
>;
export type GetMakesLeaderboardSuspenseQueryHookResult = ReturnType<
typeof useGetMakesLeaderboardSuspenseQuery
>;
export type GetMakesLeaderboardQueryResult = Apollo.QueryResult<
GetMakesLeaderboardQuery,
GetMakesLeaderboardQueryVariables
>;
export const GetVideoMakePercentageIntervalsDocument = gql` export const GetVideoMakePercentageIntervalsDocument = gql`
query GetVideoMakePercentageIntervals( query GetVideoMakePercentageIntervals(
$videoId: ID! $videoId: ID!

View File

@ -0,0 +1,12 @@
query GetMakesLeaderboard($interval: TimeInterval, $when: DateTime) {
getMakesLeaderboard(interval: $interval, when: $when) {
entries {
user {
id
username
profileImageUri
}
value
}
}
}