Compare commits

...

5 Commits

Author SHA1 Message Date
2536f5db6b add nickname to operation, remove currently unsupported fields from request
All checks were successful
Tests / Tests (pull_request) Successful in 15s
2024-11-15 16:51:17 -08:00
ffd0814a98 remove dasystreak 2024-11-15 16:44:42 -08:00
55bfe42484 Medals 2024-11-15 16:44:42 -08:00
dabb0d1d9c Merge pull request 'Remove unimplemented dayStreak and add support for nickname' (#136) from mk/add-nickname-to-medals into master
Reviewed-on: #136
2024-11-15 12:50:49 -07:00
a538c1d81c Remove unimplemented dayStreak and add support for nickname
All checks were successful
Tests / Tests (pull_request) Successful in 7s
2024-11-15 11:50:11 -08:00
3 changed files with 346 additions and 22 deletions

View File

@ -1979,6 +1979,7 @@ export type MakePercentageIntervalGql = {
export type MedalGql = { export type MedalGql = {
__typename?: "MedalGQL"; __typename?: "MedalGQL";
count: Scalars["Int"]["output"]; count: Scalars["Int"]["output"];
nickname?: Maybe<Scalars["String"]["output"]>;
}; };
export type MedalScope = export type MedalScope =
@ -2299,17 +2300,6 @@ export type QueryWaitForArgs = {
export type RequestedMedalsGql = { export type RequestedMedalsGql = {
__typename?: "RequestedMedalsGQL"; __typename?: "RequestedMedalsGQL";
dayStreak2?: Maybe<MedalGql>;
dayStreak3?: Maybe<MedalGql>;
dayStreak4?: Maybe<MedalGql>;
dayStreak5?: Maybe<MedalGql>;
dayStreak6?: Maybe<MedalGql>;
dayStreak7?: Maybe<MedalGql>;
dayStreak14?: Maybe<MedalGql>;
dayStreak21?: Maybe<MedalGql>;
dayStreak30?: Maybe<MedalGql>;
dayStreak60?: Maybe<MedalGql>;
dayStreak90?: Maybe<MedalGql>;
distanceOver66?: Maybe<MedalGql>; distanceOver66?: Maybe<MedalGql>;
distanceOver78?: Maybe<MedalGql>; distanceOver78?: Maybe<MedalGql>;
distanceOver90?: Maybe<MedalGql>; distanceOver90?: Maybe<MedalGql>;
@ -2942,6 +2932,118 @@ export type GetVideoMakePercentageIntervalsQuery = {
}>; }>;
}; };
export type GetMedalsQueryVariables = Exact<{
scope: MedalScope;
userId?: InputMaybe<Scalars["Int"]["input"]>;
}>;
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<{ export type GetSerializedShotPathsQueryVariables = Exact<{
filterInput: FilterInput; filterInput: FilterInput;
}>; }>;
@ -4766,6 +4868,154 @@ export type GetVideoMakePercentageIntervalsQueryResult = Apollo.QueryResult<
GetVideoMakePercentageIntervalsQuery, GetVideoMakePercentageIntervalsQuery,
GetVideoMakePercentageIntervalsQueryVariables 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<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) {

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

@ -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
}
}
}

View File

@ -296,21 +296,11 @@ type RequestedMedalsGQL {
totalMakes500: MedalGQL totalMakes500: MedalGQL
totalMakes750: MedalGQL totalMakes750: MedalGQL
totalMakes1000: MedalGQL totalMakes1000: MedalGQL
dayStreak2: MedalGQL
dayStreak3: MedalGQL
dayStreak4: MedalGQL
dayStreak5: MedalGQL
dayStreak6: MedalGQL
dayStreak7: MedalGQL
dayStreak14: MedalGQL
dayStreak21: MedalGQL
dayStreak30: MedalGQL
dayStreak60: MedalGQL
dayStreak90: MedalGQL
} }
type MedalGQL { type MedalGQL {
count: Int! count: Int!
nickname: String
} }
input MedalScope @oneOf { input MedalScope @oneOf {