use the same gql query for cursor management & polling
This commit is contained in:
parent
a1b3baa5c9
commit
231076496a
102
src/index.tsx
102
src/index.tsx
@ -713,6 +713,9 @@ export type GetStreamMonitoringDetailsQuery = {
|
||||
linksRequested: number;
|
||||
uploadsCompleted: number;
|
||||
segmentProcessingCursor: number;
|
||||
isCompleted: boolean;
|
||||
uploadCompletionCursor: number;
|
||||
lastIntendedSegmentBound?: number | 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`
|
||||
query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) {
|
||||
getAggregatedShotMetrics(aggregateInput: $aggregateInput) {
|
||||
@ -1658,6 +1643,9 @@ export const GetStreamMonitoringDetailsDocument = gql`
|
||||
linksRequested
|
||||
uploadsCompleted
|
||||
segmentProcessingCursor
|
||||
isCompleted
|
||||
uploadCompletionCursor
|
||||
lastIntendedSegmentBound
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2366,81 +2354,3 @@ export type GetUploadStreamsWithDetailsQueryResult = Apollo.QueryResult<
|
||||
GetUploadStreamsWithDetailsQuery,
|
||||
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
|
||||
>;
|
||||
|
@ -48,6 +48,9 @@ query GetStreamMonitoringDetails($videoId: Int!) {
|
||||
linksRequested
|
||||
uploadsCompleted
|
||||
segmentProcessingCursor
|
||||
isCompleted
|
||||
uploadCompletionCursor
|
||||
lastIntendedSegmentBound
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,14 +58,3 @@ query GetUploadStreamsWithDetails(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query GetUploadStreamDetails($videoId: Int!) {
|
||||
getVideo(videoId: $videoId) {
|
||||
id
|
||||
stream {
|
||||
isCompleted
|
||||
uploadCompletionCursor
|
||||
lastIntendedSegmentBound
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user