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>; shots: Array<ShotGql>;
startTime?: Maybe<Scalars["DateTime"]["output"]>; startTime?: Maybe<Scalars["DateTime"]["output"]>;
stream?: Maybe<UploadStreamGql>; stream?: Maybe<UploadStreamGql>;
tags: Array<VideoTag>;
totalShots: Scalars["Int"]["output"]; totalShots: Scalars["Int"]["output"];
totalShotsMade: Scalars["Int"]["output"]; totalShotsMade: Scalars["Int"]["output"];
updatedAt?: Maybe<Scalars["DateTime"]["output"]>; updatedAt?: Maybe<Scalars["DateTime"]["output"]>;
@ -442,6 +443,17 @@ export type VideoMetadataInput = {
videoName?: InputMaybe<Scalars["String"]["input"]>; 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 { export enum WallTypeEnum {
Long = "LONG", Long = "LONG",
Short = "SHORT", 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<{ export type DeleteVideoMutationVariables = Exact<{
videoId: Scalars["Int"]["input"]; videoId: Scalars["Int"]["input"];
}>; }>;
@ -1480,6 +1513,89 @@ export type GetStreamMonitoringDetailsQueryResult = Apollo.QueryResult<
GetStreamMonitoringDetailsQuery, GetStreamMonitoringDetailsQuery,
GetStreamMonitoringDetailsQueryVariables 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` export const DeleteVideoDocument = gql`
mutation DeleteVideo($videoId: Int!) { mutation DeleteVideo($videoId: Int!) {
deleteVideo(videoId: $videoId) deleteVideo(videoId: $videoId)

View File

@ -4,7 +4,6 @@ query GetStreamMonitoringDetails($videoId: Int!) {
totalShots totalShots
makePercentage makePercentage
elapsedTime elapsedTime
stream { stream {
homographyHistory { homographyHistory {
crop { 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!) { mutation DeleteVideo($videoId: Int!) {
deleteVideo(videoId: $videoId) deleteVideo(videoId: $videoId)
} }

View File

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