Remove deprecated statistics interface; add getLoggedInUser op.

This commit is contained in:
Mike Kalange 2024-03-22 12:45:58 -06:00
parent abfaf06f1a
commit 7889476bc9
3 changed files with 103 additions and 28 deletions

View File

@ -30,8 +30,6 @@ export type Scalars = {
Float: { input: number; output: number }; Float: { input: number; output: number };
/** Date with time (isoformat) */ /** Date with time (isoformat) */
DateTime: { input: any; output: any }; DateTime: { input: any; output: any };
/** Decimal (fixed-point) */
Decimal: { input: any; output: any };
}; };
export type AggregateInputGql = { export type AggregateInputGql = {
@ -397,21 +395,10 @@ export type UserGql = {
firebaseUid: Scalars["String"]["output"]; firebaseUid: Scalars["String"]["output"];
id: Scalars["Int"]["output"]; id: Scalars["Int"]["output"];
profileImageUri?: Maybe<Scalars["String"]["output"]>; profileImageUri?: Maybe<Scalars["String"]["output"]>;
statistics: UserStatisticsGql;
updatedAt?: Maybe<Scalars["DateTime"]["output"]>; updatedAt?: Maybe<Scalars["DateTime"]["output"]>;
username: Scalars["String"]["output"]; username: Scalars["String"]["output"];
}; };
export type UserStatisticsGql = {
__typename?: "UserStatisticsGQL";
averageTimeBetweenShots: Scalars["Decimal"]["output"];
makePercentage: Scalars["Decimal"]["output"];
medianRun?: Maybe<Scalars["Decimal"]["output"]>;
timeSpentPlaying: Scalars["Decimal"]["output"];
totalShots: Scalars["Int"]["output"];
totalShotsMade: Scalars["Int"]["output"];
};
export type ValueFilterBool = { export type ValueFilterBool = {
equals?: InputMaybe<Scalars["String"]["input"]>; equals?: InputMaybe<Scalars["String"]["input"]>;
}; };
@ -632,6 +619,21 @@ export type EditProfileImageUriMutation = {
}; };
}; };
export type GetLoggedInUserQueryVariables = Exact<{ [key: string]: never }>;
export type GetLoggedInUserQuery = {
__typename?: "Query";
getLoggedInUser?: {
__typename?: "UserGQL";
id: number;
firebaseUid: string;
username: string;
profileImageUri?: string | null;
createdAt?: any | null;
updatedAt?: any | null;
} | null;
};
export type GetStreamMonitoringDetailsQueryVariables = Exact<{ export type GetStreamMonitoringDetailsQueryVariables = Exact<{
videoId: Scalars["Int"]["input"]; videoId: Scalars["Int"]["input"];
}>; }>;
@ -1272,6 +1274,83 @@ export type EditProfileImageUriMutationOptions = Apollo.BaseMutationOptions<
EditProfileImageUriMutation, EditProfileImageUriMutation,
EditProfileImageUriMutationVariables EditProfileImageUriMutationVariables
>; >;
export const GetLoggedInUserDocument = gql`
query getLoggedInUser {
getLoggedInUser {
id
firebaseUid
username
profileImageUri
createdAt
updatedAt
}
}
`;
/**
* __useGetLoggedInUserQuery__
*
* To run a query within a React component, call `useGetLoggedInUserQuery` and pass it any options that fit your needs.
* When your component renders, `useGetLoggedInUserQuery` 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 } = useGetLoggedInUserQuery({
* variables: {
* },
* });
*/
export function useGetLoggedInUserQuery(
baseOptions?: Apollo.QueryHookOptions<
GetLoggedInUserQuery,
GetLoggedInUserQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<GetLoggedInUserQuery, GetLoggedInUserQueryVariables>(
GetLoggedInUserDocument,
options,
);
}
export function useGetLoggedInUserLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetLoggedInUserQuery,
GetLoggedInUserQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetLoggedInUserQuery,
GetLoggedInUserQueryVariables
>(GetLoggedInUserDocument, options);
}
export function useGetLoggedInUserSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetLoggedInUserQuery,
GetLoggedInUserQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetLoggedInUserQuery,
GetLoggedInUserQueryVariables
>(GetLoggedInUserDocument, options);
}
export type GetLoggedInUserQueryHookResult = ReturnType<
typeof useGetLoggedInUserQuery
>;
export type GetLoggedInUserLazyQueryHookResult = ReturnType<
typeof useGetLoggedInUserLazyQuery
>;
export type GetLoggedInUserSuspenseQueryHookResult = ReturnType<
typeof useGetLoggedInUserSuspenseQuery
>;
export type GetLoggedInUserQueryResult = Apollo.QueryResult<
GetLoggedInUserQuery,
GetLoggedInUserQueryVariables
>;
export const GetStreamMonitoringDetailsDocument = gql` export const GetStreamMonitoringDetailsDocument = gql`
query GetStreamMonitoringDetails($videoId: Int!) { query GetStreamMonitoringDetails($videoId: Int!) {
getVideo(videoId: $videoId) { getVideo(videoId: $videoId) {

View File

@ -18,3 +18,14 @@ mutation editProfileImageUri($profileImageUri: String!) {
updatedAt updatedAt
} }
} }
query getLoggedInUser {
getLoggedInUser {
id
firebaseUid
username
profileImageUri
createdAt
updatedAt
}
}

View File

@ -127,7 +127,6 @@ type UserGQL {
profileImageUri: String profileImageUri: String
createdAt: DateTime createdAt: DateTime
updatedAt: DateTime updatedAt: DateTime
statistics: UserStatisticsGQL!
} }
""" """
@ -135,20 +134,6 @@ Date with time (isoformat)
""" """
scalar DateTime scalar DateTime
type UserStatisticsGQL {
totalShots: Int!
totalShotsMade: Int!
makePercentage: Decimal!
averageTimeBetweenShots: Decimal!
timeSpentPlaying: Decimal!
medianRun: Decimal
}
"""
Decimal (fixed-point)
"""
scalar Decimal
type DeployedConfigGQL { type DeployedConfigGQL {
allowNewUsers: Boolean! allowNewUsers: Boolean!
} }