Add Hours Played

This commit is contained in:
Dean 2024-03-27 12:35:44 -07:00
parent 9307fbcbf4
commit 97d4f2cbe9
2 changed files with 87 additions and 0 deletions

View File

@ -664,6 +664,15 @@ export type GetLoggedInUserQuery = {
} | null; } | null;
}; };
export type GetUserPlayTimeQueryVariables = Exact<{
userId: Scalars["Int"]["input"];
}>;
export type GetUserPlayTimeQuery = {
__typename?: "Query";
getPlayTime: { __typename?: "UserPlayTimeGQL"; totalSeconds: number };
};
export type GetStreamMonitoringDetailsQueryVariables = Exact<{ export type GetStreamMonitoringDetailsQueryVariables = Exact<{
videoId: Scalars["Int"]["input"]; videoId: Scalars["Int"]["input"];
}>; }>;
@ -1415,6 +1424,79 @@ export type GetLoggedInUserQueryResult = Apollo.QueryResult<
GetLoggedInUserQuery, GetLoggedInUserQuery,
GetLoggedInUserQueryVariables GetLoggedInUserQueryVariables
>; >;
export const GetUserPlayTimeDocument = gql`
query GetUserPlayTime($userId: Int!) {
getPlayTime(userId: $userId) {
totalSeconds
}
}
`;
/**
* __useGetUserPlayTimeQuery__
*
* To run a query within a React component, call `useGetUserPlayTimeQuery` and pass it any options that fit your needs.
* When your component renders, `useGetUserPlayTimeQuery` 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 } = useGetUserPlayTimeQuery({
* variables: {
* userId: // value for 'userId'
* },
* });
*/
export function useGetUserPlayTimeQuery(
baseOptions: Apollo.QueryHookOptions<
GetUserPlayTimeQuery,
GetUserPlayTimeQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<GetUserPlayTimeQuery, GetUserPlayTimeQueryVariables>(
GetUserPlayTimeDocument,
options,
);
}
export function useGetUserPlayTimeLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetUserPlayTimeQuery,
GetUserPlayTimeQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetUserPlayTimeQuery,
GetUserPlayTimeQueryVariables
>(GetUserPlayTimeDocument, options);
}
export function useGetUserPlayTimeSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetUserPlayTimeQuery,
GetUserPlayTimeQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetUserPlayTimeQuery,
GetUserPlayTimeQueryVariables
>(GetUserPlayTimeDocument, options);
}
export type GetUserPlayTimeQueryHookResult = ReturnType<
typeof useGetUserPlayTimeQuery
>;
export type GetUserPlayTimeLazyQueryHookResult = ReturnType<
typeof useGetUserPlayTimeLazyQuery
>;
export type GetUserPlayTimeSuspenseQueryHookResult = ReturnType<
typeof useGetUserPlayTimeSuspenseQuery
>;
export type GetUserPlayTimeQueryResult = Apollo.QueryResult<
GetUserPlayTimeQuery,
GetUserPlayTimeQueryVariables
>;
export const GetStreamMonitoringDetailsDocument = gql` export const GetStreamMonitoringDetailsDocument = gql`
query GetStreamMonitoringDetails($videoId: Int!) { query GetStreamMonitoringDetails($videoId: Int!) {
getVideo(videoId: $videoId) { getVideo(videoId: $videoId) {

View File

@ -0,0 +1,5 @@
query GetUserPlayTime($userId: Int!) {
getPlayTime(userId: $userId) {
totalSeconds
}
}