new lighter weight queries

This commit is contained in:
Loewy 2024-04-23 11:49:42 -07:00
parent 5f33fae3d7
commit d51d2491ca
2 changed files with 240 additions and 0 deletions

View File

@ -786,6 +786,50 @@ export type EditUploadStreamMutation = {
editUploadStream: boolean; editUploadStream: boolean;
}; };
export type GetUploadStreamsQueryVariables = Exact<{
limit?: Scalars["Int"]["input"];
after?: InputMaybe<Scalars["String"]["input"]>;
filters?: InputMaybe<VideoFilterInput>;
}>;
export type GetUploadStreamsQuery = {
__typename?: "Query";
getUserVideos: {
__typename?: "VideoHistoryGQL";
videos: Array<{
__typename?: "VideoGQL";
id: number;
stream?: {
__typename?: "UploadStreamGQL";
isCompleted: boolean;
lowestUnuploadedSegmentIndex: number;
} | null;
}>;
pageInfo: {
__typename?: "PageInfoGQL";
hasNextPage: boolean;
endCursor?: string | null;
};
};
};
export type GetUploadStreamDetailsQueryVariables = Exact<{
videoId: Scalars["Int"]["input"];
}>;
export type GetUploadStreamDetailsQuery = {
__typename?: "Query";
getVideo: {
__typename?: "VideoGQL";
id: number;
stream?: {
__typename?: "UploadStreamGQL";
isCompleted: boolean;
lowestUnuploadedSegmentIndex: number;
} | null;
};
};
export const GetAggregatedShotMetricsDocument = gql` export const GetAggregatedShotMetricsDocument = gql`
query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) { query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) {
getAggregatedShotMetrics(aggregateInput: $aggregateInput) { getAggregatedShotMetrics(aggregateInput: $aggregateInput) {
@ -1986,3 +2030,169 @@ export type EditUploadStreamMutationOptions = Apollo.BaseMutationOptions<
EditUploadStreamMutation, EditUploadStreamMutation,
EditUploadStreamMutationVariables EditUploadStreamMutationVariables
>; >;
export const GetUploadStreamsDocument = gql`
query GetUploadStreams(
$limit: Int! = 5
$after: String = null
$filters: VideoFilterInput = null
) {
getUserVideos(limit: $limit, after: $after, filters: $filters) {
videos {
id
stream {
isCompleted
lowestUnuploadedSegmentIndex
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
`;
/**
* __useGetUploadStreamsQuery__
*
* To run a query within a React component, call `useGetUploadStreamsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetUploadStreamsQuery` 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 } = useGetUploadStreamsQuery({
* variables: {
* limit: // value for 'limit'
* after: // value for 'after'
* filters: // value for 'filters'
* },
* });
*/
export function useGetUploadStreamsQuery(
baseOptions?: Apollo.QueryHookOptions<
GetUploadStreamsQuery,
GetUploadStreamsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<GetUploadStreamsQuery, GetUploadStreamsQueryVariables>(
GetUploadStreamsDocument,
options,
);
}
export function useGetUploadStreamsLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetUploadStreamsQuery,
GetUploadStreamsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetUploadStreamsQuery,
GetUploadStreamsQueryVariables
>(GetUploadStreamsDocument, options);
}
export function useGetUploadStreamsSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetUploadStreamsQuery,
GetUploadStreamsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetUploadStreamsQuery,
GetUploadStreamsQueryVariables
>(GetUploadStreamsDocument, options);
}
export type GetUploadStreamsQueryHookResult = ReturnType<
typeof useGetUploadStreamsQuery
>;
export type GetUploadStreamsLazyQueryHookResult = ReturnType<
typeof useGetUploadStreamsLazyQuery
>;
export type GetUploadStreamsSuspenseQueryHookResult = ReturnType<
typeof useGetUploadStreamsSuspenseQuery
>;
export type GetUploadStreamsQueryResult = Apollo.QueryResult<
GetUploadStreamsQuery,
GetUploadStreamsQueryVariables
>;
export const GetUploadStreamDetailsDocument = gql`
query GetUploadStreamDetails($videoId: Int!) {
getVideo(videoId: $videoId) {
id
stream {
isCompleted
lowestUnuploadedSegmentIndex
}
}
}
`;
/**
* __useGetUploadStreamDetailsQuery__
*
* To run a query within a React component, call `useGetUploadStreamDetailsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetUploadStreamDetailsQuery` 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 } = useGetUploadStreamDetailsQuery({
* variables: {
* videoId: // value for 'videoId'
* },
* });
*/
export function useGetUploadStreamDetailsQuery(
baseOptions: Apollo.QueryHookOptions<
GetUploadStreamDetailsQuery,
GetUploadStreamDetailsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useQuery<
GetUploadStreamDetailsQuery,
GetUploadStreamDetailsQueryVariables
>(GetUploadStreamDetailsDocument, options);
}
export function useGetUploadStreamDetailsLazyQuery(
baseOptions?: Apollo.LazyQueryHookOptions<
GetUploadStreamDetailsQuery,
GetUploadStreamDetailsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useLazyQuery<
GetUploadStreamDetailsQuery,
GetUploadStreamDetailsQueryVariables
>(GetUploadStreamDetailsDocument, options);
}
export function useGetUploadStreamDetailsSuspenseQuery(
baseOptions?: Apollo.SuspenseQueryHookOptions<
GetUploadStreamDetailsQuery,
GetUploadStreamDetailsQueryVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useSuspenseQuery<
GetUploadStreamDetailsQuery,
GetUploadStreamDetailsQueryVariables
>(GetUploadStreamDetailsDocument, options);
}
export type GetUploadStreamDetailsQueryHookResult = ReturnType<
typeof useGetUploadStreamDetailsQuery
>;
export type GetUploadStreamDetailsLazyQueryHookResult = ReturnType<
typeof useGetUploadStreamDetailsLazyQuery
>;
export type GetUploadStreamDetailsSuspenseQueryHookResult = ReturnType<
typeof useGetUploadStreamDetailsSuspenseQuery
>;
export type GetUploadStreamDetailsQueryResult = Apollo.QueryResult<
GetUploadStreamDetailsQuery,
GetUploadStreamDetailsQueryVariables
>;

View File

@ -20,3 +20,33 @@ mutation EditUploadStream(
) { ) {
editUploadStream(videoId: $videoId, videoMetadata: $videoMetadataInput) editUploadStream(videoId: $videoId, videoMetadata: $videoMetadataInput)
} }
query GetUploadStreams(
$limit: Int! = 5
$after: String = null
$filters: VideoFilterInput = null
) {
getUserVideos(limit: $limit, after: $after, filters: $filters) {
videos {
id
stream {
isCompleted
lowestUnuploadedSegmentIndex
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
query GetUploadStreamDetails($videoId: Int!) {
getVideo(videoId: $videoId) {
id
stream {
isCompleted
lowestUnuploadedSegmentIndex
}
}
}