Add an operation to get details for updating a video

Fixes railbird/railbird#1164
This commit is contained in:
Ivan Malison 2024-03-22 19:27:57 -06:00
parent 87fabdc8f9
commit 8102a0f40b
3 changed files with 142 additions and 1 deletions

View File

@ -428,6 +428,7 @@ export type VideoGql = {
shots: Array<ShotGql>;
startTime?: Maybe<Scalars["DateTime"]["output"]>;
stream?: Maybe<UploadStreamGql>;
tags: Array<VideoTag>;
totalShots: Scalars["Int"]["output"];
totalShotsMade: Scalars["Int"]["output"];
updatedAt?: Maybe<Scalars["DateTime"]["output"]>;
@ -442,6 +443,17 @@ export type VideoMetadataInput = {
videoName?: InputMaybe<Scalars["String"]["input"]>;
};
export type VideoTag = {
__typename?: "VideoTag";
name: Scalars["String"]["output"];
tagClasses: Array<VideoTagClass>;
};
export type VideoTagClass = {
__typename?: "VideoTagClass";
name: Scalars["String"]["output"];
};
export enum WallTypeEnum {
Long = "LONG",
Short = "SHORT",
@ -682,6 +694,27 @@ export type GetStreamMonitoringDetailsQuery = {
};
};
export type GetVideoUpdatePageDetailsQueryVariables = Exact<{
videoId: Scalars["Int"]["input"];
}>;
export type GetVideoUpdatePageDetailsQuery = {
__typename?: "Query";
getVideo: {
__typename?: "VideoGQL";
id: number;
name?: string | null;
totalShots: number;
makePercentage: number;
elapsedTime?: number | null;
tags: Array<{
__typename?: "VideoTag";
name: string;
tagClasses: Array<{ __typename?: "VideoTagClass"; name: string }>;
}>;
};
};
export type DeleteVideoMutationVariables = Exact<{
videoId: Scalars["Int"]["input"];
}>;
@ -1480,6 +1513,89 @@ export type GetStreamMonitoringDetailsQueryResult = Apollo.QueryResult<
GetStreamMonitoringDetailsQuery,
GetStreamMonitoringDetailsQueryVariables
>;
export const GetVideoUpdatePageDetailsDocument = gql`
query GetVideoUpdatePageDetails($videoId: Int!) {
getVideo(videoId: $videoId) {
id
name
totalShots
makePercentage
elapsedTime
tags {
tagClasses {
name
}
name
}
}
}
`;
/**
* __useGetVideoUpdatePageDetailsQuery__
*
* To run a query within a React component, call `useGetVideoUpdatePageDetailsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetVideoUpdatePageDetailsQuery` 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 } = useGetVideoUpdatePageDetailsQuery({
* variables: {
* videoId: // value for 'videoId'
* },
* });
*/
export function useGetVideoUpdatePageDetailsQuery(
baseOptions: Apollo.QueryHookOptions<
GetVideoUpdatePageDetailsQuery,
GetVideoUpdatePageDetailsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetVideoUpdatePageDetailsQuery,
GetVideoUpdatePageDetailsQueryVariables
>(GetVideoUpdatePageDetailsDocument, options);
}
export function useGetVideoUpdatePageDetailsLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetVideoUpdatePageDetailsQuery,
GetVideoUpdatePageDetailsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetVideoUpdatePageDetailsQuery,
GetVideoUpdatePageDetailsQueryVariables
>(GetVideoUpdatePageDetailsDocument, options);
}
export function useGetVideoUpdatePageDetailsSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetVideoUpdatePageDetailsQuery,
GetVideoUpdatePageDetailsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetVideoUpdatePageDetailsQuery,
GetVideoUpdatePageDetailsQueryVariables
>(GetVideoUpdatePageDetailsDocument, options);
}
export type GetVideoUpdatePageDetailsQueryHookResult = ReturnType<
typeof useGetVideoUpdatePageDetailsQuery
>;
export type GetVideoUpdatePageDetailsLazyQueryHookResult = ReturnType<
typeof useGetVideoUpdatePageDetailsLazyQuery
>;
export type GetVideoUpdatePageDetailsSuspenseQueryHookResult = ReturnType<
typeof useGetVideoUpdatePageDetailsSuspenseQuery
>;
export type GetVideoUpdatePageDetailsQueryResult = Apollo.QueryResult<
GetVideoUpdatePageDetailsQuery,
GetVideoUpdatePageDetailsQueryVariables
>;
export const DeleteVideoDocument = gql`
mutation DeleteVideo($videoId: Int!) {
deleteVideo(videoId: $videoId)

View File

@ -4,7 +4,6 @@ query GetStreamMonitoringDetails($videoId: Int!) {
totalShots
makePercentage
elapsedTime
stream {
homographyHistory {
crop {
@ -53,6 +52,22 @@ query GetStreamMonitoringDetails($videoId: Int!) {
}
}
query GetVideoUpdatePageDetails($videoId: Int!) {
getVideo(videoId: $videoId) {
id
name
totalShots
makePercentage
elapsedTime
tags {
tagClasses {
name
}
name
}
}
}
mutation DeleteVideo($videoId: Int!) {
deleteVideo(videoId: $videoId)
}

View File

@ -155,6 +155,7 @@ type VideoGQL {
elapsedTime: Float
framesPerSecond: Int!
stream: UploadStreamGQL
tags: [VideoTag!]!
}
type ShotGQL {
@ -258,6 +259,15 @@ type StreamErrorGQL {
message: String!
}
type VideoTag {
tagClasses: [VideoTagClass!]!
name: String!
}
type VideoTagClass {
name: String!
}
type BucketSetGQL {
keyName: String!
feature: String!