Generalize terminateUploadStream into editUploadStream

This commit is contained in:
Ivan Malison 2024-03-24 21:01:02 -06:00
parent d3c5979d3e
commit 050705c370
3 changed files with 37 additions and 38 deletions

View File

@ -193,9 +193,9 @@ export type Mutation = {
createUploadStream: CreateUploadStreamReturn;
deleteVideo: Scalars["Boolean"]["output"];
editProfileImageUri: UserGql;
editUploadStream: Scalars["Boolean"]["output"];
getProfileImageUploadLink: GetUploadLinkReturn;
getUploadLink: GetUploadLinkReturn;
terminateUploadStream: Scalars["Boolean"]["output"];
};
export type MutationCreateBucketSetArgs = {
@ -214,6 +214,11 @@ export type MutationEditProfileImageUriArgs = {
profileImageUri: Scalars["String"]["input"];
};
export type MutationEditUploadStreamArgs = {
videoId: Scalars["Int"]["input"];
videoMetadata: VideoMetadataInput;
};
export type MutationGetProfileImageUploadLinkArgs = {
fileExt?: InputMaybe<Scalars["String"]["input"]>;
};
@ -223,11 +228,6 @@ export type MutationGetUploadLinkArgs = {
videoId: Scalars["Int"]["input"];
};
export type MutationTerminateUploadStreamArgs = {
videoId: Scalars["Int"]["input"];
videoMetadata: VideoMetadataInput;
};
export type OrFilter = {
filters: Array<FilterInput>;
};
@ -436,6 +436,7 @@ export type VideoGql = {
};
export type VideoMetadataInput = {
endStream?: Scalars["Boolean"]["input"];
endTime?: InputMaybe<Scalars["DateTime"]["input"]>;
gameType?: InputMaybe<Scalars["String"]["input"]>;
startTime?: InputMaybe<Scalars["DateTime"]["input"]>;
@ -755,14 +756,14 @@ export type GetUploadLinkMutation = {
};
};
export type TerminateUploadStreamMutationVariables = Exact<{
export type EditUploadStreamMutationVariables = Exact<{
videoId: Scalars["Int"]["input"];
videoMetadataInput: VideoMetadataInput;
}>;
export type TerminateUploadStreamMutation = {
export type EditUploadStreamMutation = {
__typename?: "Mutation";
terminateUploadStream: boolean;
editUploadStream: boolean;
};
export const GetAggregatedShotMetricsDocument = gql`
@ -1750,55 +1751,55 @@ export type GetUploadLinkMutationOptions = Apollo.BaseMutationOptions<
GetUploadLinkMutation,
GetUploadLinkMutationVariables
>;
export const TerminateUploadStreamDocument = gql`
mutation TerminateUploadStream(
export const EditUploadStreamDocument = gql`
mutation EditUploadStream(
$videoId: Int!
$videoMetadataInput: VideoMetadataInput!
) {
terminateUploadStream(videoId: $videoId, videoMetadata: $videoMetadataInput)
editUploadStream(videoId: $videoId, videoMetadata: $videoMetadataInput)
}
`;
export type TerminateUploadStreamMutationFn = Apollo.MutationFunction<
TerminateUploadStreamMutation,
TerminateUploadStreamMutationVariables
export type EditUploadStreamMutationFn = Apollo.MutationFunction<
EditUploadStreamMutation,
EditUploadStreamMutationVariables
>;
/**
* __useTerminateUploadStreamMutation__
* __useEditUploadStreamMutation__
*
* To run a mutation, you first call `useTerminateUploadStreamMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useTerminateUploadStreamMutation` returns a tuple that includes:
* To run a mutation, you first call `useEditUploadStreamMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useEditUploadStreamMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [terminateUploadStreamMutation, { data, loading, error }] = useTerminateUploadStreamMutation({
* const [editUploadStreamMutation, { data, loading, error }] = useEditUploadStreamMutation({
* variables: {
* videoId: // value for 'videoId'
* videoMetadataInput: // value for 'videoMetadataInput'
* },
* });
*/
export function useTerminateUploadStreamMutation(
export function useEditUploadStreamMutation(
baseOptions?: Apollo.MutationHookOptions<
TerminateUploadStreamMutation,
TerminateUploadStreamMutationVariables
EditUploadStreamMutation,
EditUploadStreamMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<
TerminateUploadStreamMutation,
TerminateUploadStreamMutationVariables
>(TerminateUploadStreamDocument, options);
EditUploadStreamMutation,
EditUploadStreamMutationVariables
>(EditUploadStreamDocument, options);
}
export type TerminateUploadStreamMutationHookResult = ReturnType<
typeof useTerminateUploadStreamMutation
export type EditUploadStreamMutationHookResult = ReturnType<
typeof useEditUploadStreamMutation
>;
export type TerminateUploadStreamMutationResult =
Apollo.MutationResult<TerminateUploadStreamMutation>;
export type TerminateUploadStreamMutationOptions = Apollo.BaseMutationOptions<
TerminateUploadStreamMutation,
TerminateUploadStreamMutationVariables
export type EditUploadStreamMutationResult =
Apollo.MutationResult<EditUploadStreamMutation>;
export type EditUploadStreamMutationOptions = Apollo.BaseMutationOptions<
EditUploadStreamMutation,
EditUploadStreamMutationVariables
>;

View File

@ -14,9 +14,9 @@ mutation GetUploadLink($videoId: Int!, $segmentIndex: Int!) {
}
}
mutation TerminateUploadStream(
mutation EditUploadStream(
$videoId: Int!
$videoMetadataInput: VideoMetadataInput!
) {
terminateUploadStream(videoId: $videoId, videoMetadata: $videoMetadataInput)
editUploadStream(videoId: $videoId, videoMetadata: $videoMetadataInput)
}

View File

@ -296,10 +296,7 @@ type Mutation {
videoMetadata: VideoMetadataInput!
): CreateUploadStreamReturn!
getUploadLink(videoId: Int!, segmentIndex: Int!): GetUploadLinkReturn!
terminateUploadStream(
videoId: Int!
videoMetadata: VideoMetadataInput!
): Boolean!
editUploadStream(videoId: Int!, videoMetadata: VideoMetadataInput!): Boolean!
deleteVideo(videoId: Int!): Boolean!
getProfileImageUploadLink(fileExt: String = ".png"): GetUploadLinkReturn!
editProfileImageUri(profileImageUri: String!): UserGQL!
@ -322,6 +319,7 @@ input VideoMetadataInput {
gameType: String = null
tableSize: String = null
uploadStreamMetadataInput: UploadStreamMetadataInput = null
endStream: Boolean! = false
}
input UploadStreamMetadataInput {