Merge branch 'master' into loewy/restore-cursor-state-from-api

This commit is contained in:
Loewy 2024-04-23 15:36:37 -07:00
commit 2da00ca814
3 changed files with 126 additions and 0 deletions

View File

@ -153,6 +153,13 @@ export type GetUploadLinkReturn = {
uploadUrl: Scalars["String"]["output"];
};
export type HlsPlaylistGql = {
__typename?: "HLSPlaylistGQL";
m3u8Text: Scalars["String"]["output"];
segmentDurations: Array<Scalars["Float"]["output"]>;
videoId: Scalars["Int"]["output"];
};
export type Header = {
__typename?: "Header";
key: Scalars["String"]["output"];
@ -271,6 +278,7 @@ export type Query = {
getUserVideos: VideoHistoryGql;
getVideo: VideoGql;
getVideoMakePercentageIntervals: Array<MakePercentageIntervalGql>;
getVideos: Array<VideoGql>;
};
export type QueryGetAggregatedShotMetricsArgs = {
@ -309,6 +317,10 @@ export type QueryGetVideoMakePercentageIntervalsArgs = {
videoId: Scalars["ID"]["input"];
};
export type QueryGetVideosArgs = {
videoIds: Array<Scalars["Int"]["input"]>;
};
export type RangeFilter = {
greaterThanEqualTo?: InputMaybe<Scalars["Float"]["input"]>;
lessThan?: InputMaybe<Scalars["Float"]["input"]>;
@ -402,6 +414,7 @@ export type VideoGql = {
medianRun?: Maybe<Scalars["Float"]["output"]>;
name?: Maybe<Scalars["String"]["output"]>;
owner?: Maybe<UserGql>;
playlist?: Maybe<HlsPlaylistGql>;
shots: Array<ShotGql>;
startTime?: Maybe<Scalars["DateTime"]["output"]>;
stream?: Maybe<UploadStreamGql>;
@ -742,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;
}>;
@ -1860,6 +1892,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

@ -102,3 +102,15 @@ query GetVideoDetails($videoId: Int!) {
}
}
}
query GetVideos($videoIds: [Int!]!) {
getVideos(videoIds: $videoIds) {
id
name
framesPerSecond
playlist {
m3u8Text
segmentDurations
}
}
}

View File

@ -19,6 +19,7 @@ type Query {
filters: VideoFilterInput = null
): VideoHistoryGQL!
getVideo(videoId: Int!): VideoGQL!
getVideos(videoIds: [Int!]!): [VideoGQL!]!
}
type AggregateResultGQL {
@ -207,6 +208,7 @@ type VideoGQL {
elapsedTime: Float
framesPerSecond: Int!
stream: UploadStreamGQL
playlist: HLSPlaylistGQL
tags: [VideoTag!]!
homographyHistory: [HomographyInfoGQL!]!
}
@ -227,6 +229,12 @@ type StreamErrorGQL {
message: String!
}
type HLSPlaylistGQL {
videoId: Int!
m3u8Text: String!
segmentDurations: [Float!]!
}
type VideoTag {
tagClasses: [VideoTagClass!]!
name: String!