Medals
All checks were successful
Tests / Tests (pull_request) Successful in 8s

This commit is contained in:
Volodymyr Smolianinov 2024-11-15 20:27:37 +01:00
parent 872bce3adb
commit 84a7c439aa
2 changed files with 322 additions and 0 deletions

View File

@ -2942,6 +2942,52 @@ export type GetVideoMakePercentageIntervalsQuery = {
}>; }>;
}; };
export type GetMedalsQueryVariables = Exact<{
scope: MedalScope;
userId?: InputMaybe<Scalars["Int"]["input"]>;
}>;
export type GetMedalsQuery = {
__typename?: "Query";
getMedals: {
__typename?: "RequestedMedalsGQL";
dayStreak2?: { __typename?: "MedalGQL"; count: number } | null;
dayStreak3?: { __typename?: "MedalGQL"; count: number } | null;
dayStreak4?: { __typename?: "MedalGQL"; count: number } | null;
dayStreak5?: { __typename?: "MedalGQL"; count: number } | null;
dayStreak6?: { __typename?: "MedalGQL"; count: number } | null;
dayStreak7?: { __typename?: "MedalGQL"; count: number } | null;
dayStreak14?: { __typename?: "MedalGQL"; count: number } | null;
dayStreak21?: { __typename?: "MedalGQL"; count: number } | null;
dayStreak30?: { __typename?: "MedalGQL"; count: number } | null;
dayStreak60?: { __typename?: "MedalGQL"; count: number } | null;
dayStreak90?: { __typename?: "MedalGQL"; count: number } | null;
distanceOver66?: { __typename?: "MedalGQL"; count: number } | null;
distanceOver78?: { __typename?: "MedalGQL"; count: number } | null;
distanceOver90?: { __typename?: "MedalGQL"; count: number } | null;
runLength3?: { __typename?: "MedalGQL"; count: number } | null;
runLength5?: { __typename?: "MedalGQL"; count: number } | null;
runLength8?: { __typename?: "MedalGQL"; count: number } | null;
runLength10?: { __typename?: "MedalGQL"; count: number } | null;
runLength15?: { __typename?: "MedalGQL"; count: number } | null;
runLength20?: { __typename?: "MedalGQL"; count: number } | null;
runLength25?: { __typename?: "MedalGQL"; count: number } | null;
runLength30?: { __typename?: "MedalGQL"; count: number } | null;
runLength40?: { __typename?: "MedalGQL"; count: number } | null;
runLength50?: { __typename?: "MedalGQL"; count: number } | null;
totalMakes25?: { __typename?: "MedalGQL"; count: number } | null;
totalMakes50?: { __typename?: "MedalGQL"; count: number } | null;
totalMakes75?: { __typename?: "MedalGQL"; count: number } | null;
totalMakes100?: { __typename?: "MedalGQL"; count: number } | null;
totalMakes200?: { __typename?: "MedalGQL"; count: number } | null;
totalMakes300?: { __typename?: "MedalGQL"; count: number } | null;
totalMakes400?: { __typename?: "MedalGQL"; count: number } | null;
totalMakes500?: { __typename?: "MedalGQL"; count: number } | null;
totalMakes750?: { __typename?: "MedalGQL"; count: number } | null;
totalMakes1000?: { __typename?: "MedalGQL"; count: number } | null;
};
};
export type GetSerializedShotPathsQueryVariables = Exact<{ export type GetSerializedShotPathsQueryVariables = Exact<{
filterInput: FilterInput; filterInput: FilterInput;
}>; }>;
@ -4766,6 +4812,176 @@ export type GetVideoMakePercentageIntervalsQueryResult = Apollo.QueryResult<
GetVideoMakePercentageIntervalsQuery, GetVideoMakePercentageIntervalsQuery,
GetVideoMakePercentageIntervalsQueryVariables GetVideoMakePercentageIntervalsQueryVariables
>; >;
export const GetMedalsDocument = gql`
query getMedals($scope: MedalScope!, $userId: Int) {
getMedals(scope: $scope, userId: $userId) {
dayStreak2 {
count
}
dayStreak3 {
count
}
dayStreak4 {
count
}
dayStreak5 {
count
}
dayStreak6 {
count
}
dayStreak7 {
count
}
dayStreak14 {
count
}
dayStreak21 {
count
}
dayStreak30 {
count
}
dayStreak60 {
count
}
dayStreak90 {
count
}
distanceOver66 {
count
}
distanceOver78 {
count
}
distanceOver90 {
count
}
runLength3 {
count
}
runLength5 {
count
}
runLength8 {
count
}
runLength10 {
count
}
runLength15 {
count
}
runLength20 {
count
}
runLength25 {
count
}
runLength30 {
count
}
runLength40 {
count
}
runLength50 {
count
}
totalMakes25 {
count
}
totalMakes50 {
count
}
totalMakes75 {
count
}
totalMakes100 {
count
}
totalMakes200 {
count
}
totalMakes300 {
count
}
totalMakes400 {
count
}
totalMakes500 {
count
}
totalMakes750 {
count
}
totalMakes1000 {
count
}
}
}
`;
/**
* __useGetMedalsQuery__
*
* To run a query within a React component, call `useGetMedalsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetMedalsQuery` 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 } = useGetMedalsQuery({
* variables: {
* scope: // value for 'scope'
* userId: // value for 'userId'
* },
* });
*/
export function useGetMedalsQuery(
baseOptions: Apollo.QueryHookOptions<GetMedalsQuery, GetMedalsQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<GetMedalsQuery, GetMedalsQueryVariables>(
GetMedalsDocument,
options,
);
}
export function useGetMedalsLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetMedalsQuery,
GetMedalsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<GetMedalsQuery, GetMedalsQueryVariables>(
GetMedalsDocument,
options,
);
}
export function useGetMedalsSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetMedalsQuery,
GetMedalsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<GetMedalsQuery, GetMedalsQueryVariables>(
GetMedalsDocument,
options,
);
}
export type GetMedalsQueryHookResult = ReturnType<typeof useGetMedalsQuery>;
export type GetMedalsLazyQueryHookResult = ReturnType<
typeof useGetMedalsLazyQuery
>;
export type GetMedalsSuspenseQueryHookResult = ReturnType<
typeof useGetMedalsSuspenseQuery
>;
export type GetMedalsQueryResult = Apollo.QueryResult<
GetMedalsQuery,
GetMedalsQueryVariables
>;
export const GetSerializedShotPathsDocument = gql` export const GetSerializedShotPathsDocument = gql`
query GetSerializedShotPaths($filterInput: FilterInput!) { query GetSerializedShotPaths($filterInput: FilterInput!) {
getShots(filterInput: $filterInput) { getShots(filterInput: $filterInput) {

106
src/operations/medals.gql Normal file
View File

@ -0,0 +1,106 @@
query getMedals($scope: MedalScope!, $userId: Int) {
getMedals(scope: $scope, userId: $userId) {
dayStreak2 {
count
}
dayStreak3 {
count
}
dayStreak4 {
count
}
dayStreak5 {
count
}
dayStreak6 {
count
}
dayStreak7 {
count
}
dayStreak14 {
count
}
dayStreak21 {
count
}
dayStreak30 {
count
}
dayStreak60 {
count
}
dayStreak90 {
count
}
distanceOver66 {
count
}
distanceOver78 {
count
}
distanceOver90 {
count
}
runLength3 {
count
}
runLength5 {
count
}
runLength8 {
count
}
runLength10 {
count
}
runLength15 {
count
}
runLength20 {
count
}
runLength25 {
count
}
runLength30 {
count
}
runLength40 {
count
}
runLength50 {
count
}
totalMakes25 {
count
}
totalMakes50 {
count
}
totalMakes75 {
count
}
totalMakes100 {
count
}
totalMakes200 {
count
}
totalMakes300 {
count
}
totalMakes400 {
count
}
totalMakes500 {
count
}
totalMakes750 {
count
}
totalMakes1000 {
count
}
}
}