use the same gql query for cursor management & polling

This commit is contained in:
Loewy 2024-05-09 16:59:44 -07:00
parent a1b3baa5c9
commit 231076496a
3 changed files with 9 additions and 107 deletions

View File

@ -713,6 +713,9 @@ export type GetStreamMonitoringDetailsQuery = {
linksRequested: number; linksRequested: number;
uploadsCompleted: number; uploadsCompleted: number;
segmentProcessingCursor: number; segmentProcessingCursor: number;
isCompleted: boolean;
uploadCompletionCursor: number;
lastIntendedSegmentBound?: number | null;
} | null; } | null;
}; };
}; };
@ -891,24 +894,6 @@ export type GetUploadStreamsWithDetailsQuery = {
}; };
}; };
export type GetUploadStreamDetailsQueryVariables = Exact<{
videoId: Scalars["Int"]["input"];
}>;
export type GetUploadStreamDetailsQuery = {
__typename?: "Query";
getVideo: {
__typename?: "VideoGQL";
id: number;
stream?: {
__typename?: "UploadStreamGQL";
isCompleted: boolean;
uploadCompletionCursor: number;
lastIntendedSegmentBound?: number | null;
} | null;
};
};
export const GetAggregatedShotMetricsDocument = gql` export const GetAggregatedShotMetricsDocument = gql`
query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) { query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) {
getAggregatedShotMetrics(aggregateInput: $aggregateInput) { getAggregatedShotMetrics(aggregateInput: $aggregateInput) {
@ -1658,6 +1643,9 @@ export const GetStreamMonitoringDetailsDocument = gql`
linksRequested linksRequested
uploadsCompleted uploadsCompleted
segmentProcessingCursor segmentProcessingCursor
isCompleted
uploadCompletionCursor
lastIntendedSegmentBound
} }
} }
} }
@ -2366,81 +2354,3 @@ export type GetUploadStreamsWithDetailsQueryResult = Apollo.QueryResult<
GetUploadStreamsWithDetailsQuery, GetUploadStreamsWithDetailsQuery,
GetUploadStreamsWithDetailsQueryVariables GetUploadStreamsWithDetailsQueryVariables
>; >;
export const GetUploadStreamDetailsDocument = gql`
query GetUploadStreamDetails($videoId: Int!) {
getVideo(videoId: $videoId) {
id
stream {
isCompleted
uploadCompletionCursor
lastIntendedSegmentBound
}
}
}
`;
/**
* __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

@ -48,6 +48,9 @@ query GetStreamMonitoringDetails($videoId: Int!) {
linksRequested linksRequested
uploadsCompleted uploadsCompleted
segmentProcessingCursor segmentProcessingCursor
isCompleted
uploadCompletionCursor
lastIntendedSegmentBound
} }
} }
} }

View File

@ -58,14 +58,3 @@ query GetUploadStreamsWithDetails(
} }
} }
} }
query GetUploadStreamDetails($videoId: Int!) {
getVideo(videoId: $videoId) {
id
stream {
isCompleted
uploadCompletionCursor
lastIntendedSegmentBound
}
}
}