From 55bfe42484dd0d994b4c36b432cedc536657f0ff Mon Sep 17 00:00:00 2001 From: Volodymyr Smolianinov Date: Fri, 15 Nov 2024 20:27:37 +0100 Subject: [PATCH 1/3] Medals --- src/index.tsx | 216 ++++++++++++++++++++++++++++++++++++++ src/operations/medals.gql | 106 +++++++++++++++++++ 2 files changed, 322 insertions(+) create mode 100644 src/operations/medals.gql diff --git a/src/index.tsx b/src/index.tsx index da9af37..29bda20 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2932,6 +2932,52 @@ export type GetVideoMakePercentageIntervalsQuery = { }>; }; +export type GetMedalsQueryVariables = Exact<{ + scope: MedalScope; + userId?: InputMaybe; +}>; + +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<{ filterInput: FilterInput; }>; @@ -4756,6 +4802,176 @@ export type GetVideoMakePercentageIntervalsQueryResult = Apollo.QueryResult< GetVideoMakePercentageIntervalsQuery, 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, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + GetMedalsDocument, + options, + ); +} +export function useGetMedalsLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetMedalsQuery, + GetMedalsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery( + GetMedalsDocument, + options, + ); +} +export function useGetMedalsSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GetMedalsQuery, + GetMedalsQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + GetMedalsDocument, + options, + ); +} +export type GetMedalsQueryHookResult = ReturnType; +export type GetMedalsLazyQueryHookResult = ReturnType< + typeof useGetMedalsLazyQuery +>; +export type GetMedalsSuspenseQueryHookResult = ReturnType< + typeof useGetMedalsSuspenseQuery +>; +export type GetMedalsQueryResult = Apollo.QueryResult< + GetMedalsQuery, + GetMedalsQueryVariables +>; export const GetSerializedShotPathsDocument = gql` query GetSerializedShotPaths($filterInput: FilterInput!) { getShots(filterInput: $filterInput) { diff --git a/src/operations/medals.gql b/src/operations/medals.gql new file mode 100644 index 0000000..85336f1 --- /dev/null +++ b/src/operations/medals.gql @@ -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 + } + } +} -- 2.46.1 From ffd0814a98c923a20cc6cb298950e25c7c7bc895 Mon Sep 17 00:00:00 2001 From: Loewy Date: Fri, 15 Nov 2024 12:51:46 -0800 Subject: [PATCH 2/3] remove dasystreak --- src/index.tsx | 44 --------------------------------------- src/operations/medals.gql | 33 ----------------------------- 2 files changed, 77 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 29bda20..26d8a48 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2941,17 +2941,6 @@ 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; @@ -4805,39 +4794,6 @@ export type GetVideoMakePercentageIntervalsQueryResult = Apollo.QueryResult< 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 } diff --git a/src/operations/medals.gql b/src/operations/medals.gql index 85336f1..51a3457 100644 --- a/src/operations/medals.gql +++ b/src/operations/medals.gql @@ -1,38 +1,5 @@ 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 } -- 2.46.1 From 2536f5db6bd3049f2fc93cc9b9637bbeccf349ca Mon Sep 17 00:00:00 2001 From: Loewy Date: Fri, 15 Nov 2024 16:51:17 -0800 Subject: [PATCH 3/3] add nickname to operation, remove currently unsupported fields from request --- src/index.tsx | 152 ++++++++++++++++++++++++++++++-------- src/operations/medals.gql | 29 +++++--- 2 files changed, 140 insertions(+), 41 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 26d8a48..8937756 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2941,29 +2941,106 @@ export type GetMedalsQuery = { __typename?: "Query"; getMedals: { __typename?: "RequestedMedalsGQL"; - 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; + distanceOver66?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + distanceOver78?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + distanceOver90?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + runLength3?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + runLength5?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + runLength8?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + runLength10?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + runLength15?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + runLength20?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + runLength25?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + runLength30?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + runLength40?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + runLength50?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + totalMakes25?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + totalMakes50?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + totalMakes75?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + totalMakes100?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + totalMakes200?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + totalMakes300?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; + totalMakes400?: { + __typename?: "MedalGQL"; + count: number; + nickname?: string | null; + } | null; }; }; @@ -4796,72 +4873,83 @@ export const GetMedalsDocument = gql` getMedals(scope: $scope, userId: $userId) { distanceOver66 { count + nickname } distanceOver78 { count + nickname } distanceOver90 { count + nickname } runLength3 { count + nickname } runLength5 { count + nickname } runLength8 { count + nickname } runLength10 { count + nickname } runLength15 { count + nickname } runLength20 { count + nickname } runLength25 { count + nickname } runLength30 { count + nickname } runLength40 { count + nickname } runLength50 { count + nickname } totalMakes25 { count + nickname } totalMakes50 { count + nickname } totalMakes75 { count + nickname } totalMakes100 { count + nickname } totalMakes200 { count + nickname } totalMakes300 { count + nickname } totalMakes400 { count - } - totalMakes500 { - count - } - totalMakes750 { - count - } - totalMakes1000 { - count + nickname } } } diff --git a/src/operations/medals.gql b/src/operations/medals.gql index 51a3457..97886dc 100644 --- a/src/operations/medals.gql +++ b/src/operations/medals.gql @@ -2,72 +2,83 @@ query getMedals($scope: MedalScope!, $userId: Int) { getMedals(scope: $scope, userId: $userId) { distanceOver66 { count + nickname } distanceOver78 { count + nickname } distanceOver90 { count + nickname } runLength3 { count + nickname } runLength5 { count + nickname } runLength8 { count + nickname } runLength10 { count + nickname } runLength15 { count + nickname } runLength20 { count + nickname } runLength25 { count + nickname } runLength30 { count + nickname } runLength40 { count + nickname } runLength50 { count + nickname } totalMakes25 { count + nickname } totalMakes50 { count + nickname } totalMakes75 { count + nickname } totalMakes100 { count + nickname } totalMakes200 { count + nickname } totalMakes300 { count + nickname } totalMakes400 { count - } - totalMakes500 { - count - } - totalMakes750 { - count - } - totalMakes1000 { - count + nickname } } } -- 2.46.1