Add generated api hooks

This commit is contained in:
Kat Huang 2024-04-22 22:20:59 -06:00
parent c6c5971325
commit db39c5a576
2 changed files with 96 additions and 21 deletions

View File

@ -755,6 +755,25 @@ export type GetVideoDetailsQuery = {
};
};
export type GetVideosQueryVariables = Exact<{
videoIds: Array<Scalars["Int"]["input"]> | Scalars["Int"]["input"];
}>;
export type GetVideosQuery = {
__typename?: "Query";
getVideos: Array<{
__typename?: "VideoGQL";
id: number;
name?: string | null;
framesPerSecond: number;
playlist?: {
__typename?: "HLSPlaylistGQL";
m3u8Text: string;
segmentDurations: Array<number>;
} | null;
}>;
};
export type CreateUploadStreamMutationVariables = Exact<{
videoMetadataInput: VideoMetadataInput;
}>;
@ -1837,6 +1856,80 @@ export type GetVideoDetailsQueryResult = Apollo.QueryResult<
GetVideoDetailsQuery,
GetVideoDetailsQueryVariables
>;
export const GetVideosDocument = gql`
query GetVideos($videoIds: [Int!]!) {
getVideos(videoIds: $videoIds) {
id
name
framesPerSecond
playlist {
m3u8Text
segmentDurations
}
}
}
`;
/**
* __useGetVideosQuery__
*
* To run a query within a React component, call `useGetVideosQuery` and pass it any options that fit your needs.
* When your component renders, `useGetVideosQuery` 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 } = useGetVideosQuery({
* variables: {
* videoIds: // value for 'videoIds'
* },
* });
*/
export function useGetVideosQuery(
baseOptions: Apollo.QueryHookOptions<GetVideosQuery, GetVideosQueryVariables>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<GetVideosQuery, GetVideosQueryVariables>(
GetVideosDocument,
options,
);
}
export function useGetVideosLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetVideosQuery,
GetVideosQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<GetVideosQuery, GetVideosQueryVariables>(
GetVideosDocument,
options,
);
}
export function useGetVideosSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetVideosQuery,
GetVideosQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<GetVideosQuery, GetVideosQueryVariables>(
GetVideosDocument,
options,
);
}
export type GetVideosQueryHookResult = ReturnType<typeof useGetVideosQuery>;
export type GetVideosLazyQueryHookResult = ReturnType<
typeof useGetVideosLazyQuery
>;
export type GetVideosSuspenseQueryHookResult = ReturnType<
typeof useGetVideosSuspenseQuery
>;
export type GetVideosQueryResult = Apollo.QueryResult<
GetVideosQuery,
GetVideosQueryVariables
>;
export const CreateUploadStreamDocument = gql`
mutation CreateUploadStream($videoMetadataInput: VideoMetadataInput!) {
createUploadStream(videoMetadata: $videoMetadataInput) {

View File

@ -107,28 +107,10 @@ query GetVideos($videoIds: [Int!]!) {
getVideos(videoIds: $videoIds) {
id
name
frames_per_second
owner {
id
firebaseUid
username
profileImageUri
}
tags {
tagClasses {
name
}
name
}
framesPerSecond
playlist {
video_id
m3u8_text
segment_durations
}
shots {
id
timeOffset
coordinates
m3u8Text
segmentDurations
}
}
}