Compare commits

...

2 Commits

Author SHA1 Message Date
59aaf47cbe Merge pull request 'Add a lightweight GQL call to get video header info' (#73) from loewy/add-lightweight-get-video-with-just-header-info into master
Reviewed-on: #73
2024-10-10 18:33:42 -06:00
c426e753cd add lightweigth gql call to get video header info
All checks were successful
Tests / Tests (pull_request) Successful in 15s
2024-10-10 17:02:18 -07:00
2 changed files with 97 additions and 0 deletions

View File

@ -2970,6 +2970,20 @@ export type GetVideoForClipTimesQuery = {
};
};
export type GetHeaderInfoByVideoIdQueryVariables = Exact<{
videoId: Scalars["Int"]["input"];
}>;
export type GetHeaderInfoByVideoIdQuery = {
__typename?: "Query";
getVideo: {
__typename?: "VideoGQL";
id: number;
name?: string | null;
startTime?: any | null;
};
};
export type CreateUploadStreamMutationVariables = Exact<{
videoMetadataInput: VideoMetadataInput;
}>;
@ -5227,6 +5241,81 @@ export type GetVideoForClipTimesQueryResult = Apollo.QueryResult<
GetVideoForClipTimesQuery,
GetVideoForClipTimesQueryVariables
>;
export const GetHeaderInfoByVideoIdDocument = gql`
query GetHeaderInfoByVideoId($videoId: Int!) {
getVideo(videoId: $videoId) {
id
name
startTime
}
}
`;
/**
* __useGetHeaderInfoByVideoIdQuery__
*
* To run a query within a React component, call `useGetHeaderInfoByVideoIdQuery` and pass it any options that fit your needs.
* When your component renders, `useGetHeaderInfoByVideoIdQuery` 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 } = useGetHeaderInfoByVideoIdQuery({
* variables: {
* videoId: // value for 'videoId'
* },
* });
*/
export function useGetHeaderInfoByVideoIdQuery(
baseOptions: Apollo.QueryHookOptions<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>(GetHeaderInfoByVideoIdDocument, options);
}
export function useGetHeaderInfoByVideoIdLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>(GetHeaderInfoByVideoIdDocument, options);
}
export function useGetHeaderInfoByVideoIdSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>(GetHeaderInfoByVideoIdDocument, options);
}
export type GetHeaderInfoByVideoIdQueryHookResult = ReturnType<
typeof useGetHeaderInfoByVideoIdQuery
>;
export type GetHeaderInfoByVideoIdLazyQueryHookResult = ReturnType<
typeof useGetHeaderInfoByVideoIdLazyQuery
>;
export type GetHeaderInfoByVideoIdSuspenseQueryHookResult = ReturnType<
typeof useGetHeaderInfoByVideoIdSuspenseQuery
>;
export type GetHeaderInfoByVideoIdQueryResult = Apollo.QueryResult<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>;
export const CreateUploadStreamDocument = gql`
mutation CreateUploadStream($videoMetadataInput: VideoMetadataInput!) {
createUploadStream(videoMetadata: $videoMetadataInput) {

View File

@ -237,3 +237,11 @@ query GetVideoForClipTimes($videoId: Int!) {
}
}
}
query GetHeaderInfoByVideoId($videoId: Int!) {
getVideo(videoId: $videoId) {
id
name
startTime
}
}