diff --git a/src/index.tsx b/src/index.tsx index da9af37..8937756 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2932,6 +2932,118 @@ export type GetVideoMakePercentageIntervalsQuery = { }>; }; +export type GetMedalsQueryVariables = Exact<{ + scope: MedalScope; + userId?: InputMaybe; +}>; + +export type GetMedalsQuery = { + __typename?: "Query"; + getMedals: { + __typename?: "RequestedMedalsGQL"; + 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; + }; +}; + export type GetSerializedShotPathsQueryVariables = Exact<{ filterInput: FilterInput; }>; @@ -4756,6 +4868,154 @@ export type GetVideoMakePercentageIntervalsQueryResult = Apollo.QueryResult< GetVideoMakePercentageIntervalsQuery, GetVideoMakePercentageIntervalsQueryVariables >; +export const GetMedalsDocument = gql` + 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 + nickname + } + } + } +`; + +/** + * __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..97886dc --- /dev/null +++ b/src/operations/medals.gql @@ -0,0 +1,84 @@ +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 + nickname + } + } +}