just gql stuff + use it on uncompletedStreams hook
This commit is contained in:
parent
d4b75bcb71
commit
8378f7ae0b
124
src/index.tsx
124
src/index.tsx
@ -378,7 +378,7 @@ export type UploadStreamGql = {
|
||||
errors: Array<StreamErrorGql>;
|
||||
id: Scalars["ID"]["output"];
|
||||
isCompleted: Scalars["Boolean"]["output"];
|
||||
lastIntendedSegmentBound: Scalars["Int"]["output"];
|
||||
lastIntendedSegmentBound?: Maybe<Scalars["Int"]["output"]>;
|
||||
linksRequested: Scalars["Int"]["output"];
|
||||
lowestUnuploadedSegmentIndex: Scalars["Int"]["output"];
|
||||
segmentProcessingCursor: Scalars["Int"]["output"];
|
||||
@ -861,6 +861,36 @@ export type GetUploadStreamsQuery = {
|
||||
};
|
||||
};
|
||||
|
||||
export type GetUploadStreamsWithDetailsQueryVariables = Exact<{
|
||||
limit?: Scalars["Int"]["input"];
|
||||
after?: InputMaybe<Scalars["String"]["input"]>;
|
||||
filters?: InputMaybe<VideoFilterInput>;
|
||||
}>;
|
||||
|
||||
export type GetUploadStreamsWithDetailsQuery = {
|
||||
__typename?: "Query";
|
||||
getUserVideos: {
|
||||
__typename?: "VideoHistoryGQL";
|
||||
videos: Array<{
|
||||
__typename?: "VideoGQL";
|
||||
id: number;
|
||||
name?: string | null;
|
||||
startTime?: any | null;
|
||||
stream?: {
|
||||
__typename?: "UploadStreamGQL";
|
||||
isCompleted: boolean;
|
||||
lastIntendedSegmentBound?: number | null;
|
||||
uploadCompletionCursor: number;
|
||||
} | null;
|
||||
}>;
|
||||
pageInfo: {
|
||||
__typename?: "PageInfoGQL";
|
||||
hasNextPage: boolean;
|
||||
endCursor?: string | null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
export type GetUploadStreamDetailsQueryVariables = Exact<{
|
||||
videoId: Scalars["Int"]["input"];
|
||||
}>;
|
||||
@ -2243,6 +2273,98 @@ export type GetUploadStreamsQueryResult = Apollo.QueryResult<
|
||||
GetUploadStreamsQuery,
|
||||
GetUploadStreamsQueryVariables
|
||||
>;
|
||||
export const GetUploadStreamsWithDetailsDocument = gql`
|
||||
query GetUploadStreamsWithDetails(
|
||||
$limit: Int! = 5
|
||||
$after: String = null
|
||||
$filters: VideoFilterInput = null
|
||||
) {
|
||||
getUserVideos(limit: $limit, after: $after, filters: $filters) {
|
||||
videos {
|
||||
id
|
||||
name
|
||||
startTime
|
||||
stream {
|
||||
isCompleted
|
||||
lastIntendedSegmentBound
|
||||
uploadCompletionCursor
|
||||
}
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useGetUploadStreamsWithDetailsQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useGetUploadStreamsWithDetailsQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useGetUploadStreamsWithDetailsQuery` 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 } = useGetUploadStreamsWithDetailsQuery({
|
||||
* variables: {
|
||||
* limit: // value for 'limit'
|
||||
* after: // value for 'after'
|
||||
* filters: // value for 'filters'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useGetUploadStreamsWithDetailsQuery(
|
||||
baseOptions?: Apollo.QueryHookOptions<
|
||||
GetUploadStreamsWithDetailsQuery,
|
||||
GetUploadStreamsWithDetailsQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useQuery<
|
||||
GetUploadStreamsWithDetailsQuery,
|
||||
GetUploadStreamsWithDetailsQueryVariables
|
||||
>(GetUploadStreamsWithDetailsDocument, options);
|
||||
}
|
||||
export function useGetUploadStreamsWithDetailsLazyQuery(
|
||||
baseOptions?: Apollo.LazyQueryHookOptions<
|
||||
GetUploadStreamsWithDetailsQuery,
|
||||
GetUploadStreamsWithDetailsQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useLazyQuery<
|
||||
GetUploadStreamsWithDetailsQuery,
|
||||
GetUploadStreamsWithDetailsQueryVariables
|
||||
>(GetUploadStreamsWithDetailsDocument, options);
|
||||
}
|
||||
export function useGetUploadStreamsWithDetailsSuspenseQuery(
|
||||
baseOptions?: Apollo.SuspenseQueryHookOptions<
|
||||
GetUploadStreamsWithDetailsQuery,
|
||||
GetUploadStreamsWithDetailsQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useSuspenseQuery<
|
||||
GetUploadStreamsWithDetailsQuery,
|
||||
GetUploadStreamsWithDetailsQueryVariables
|
||||
>(GetUploadStreamsWithDetailsDocument, options);
|
||||
}
|
||||
export type GetUploadStreamsWithDetailsQueryHookResult = ReturnType<
|
||||
typeof useGetUploadStreamsWithDetailsQuery
|
||||
>;
|
||||
export type GetUploadStreamsWithDetailsLazyQueryHookResult = ReturnType<
|
||||
typeof useGetUploadStreamsWithDetailsLazyQuery
|
||||
>;
|
||||
export type GetUploadStreamsWithDetailsSuspenseQueryHookResult = ReturnType<
|
||||
typeof useGetUploadStreamsWithDetailsSuspenseQuery
|
||||
>;
|
||||
export type GetUploadStreamsWithDetailsQueryResult = Apollo.QueryResult<
|
||||
GetUploadStreamsWithDetailsQuery,
|
||||
GetUploadStreamsWithDetailsQueryVariables
|
||||
>;
|
||||
export const GetUploadStreamDetailsDocument = gql`
|
||||
query GetUploadStreamDetails($videoId: Int!) {
|
||||
getVideo(videoId: $videoId) {
|
||||
|
@ -36,6 +36,28 @@ query GetUploadStreams(
|
||||
}
|
||||
}
|
||||
}
|
||||
query GetUploadStreamsWithDetails(
|
||||
$limit: Int! = 5
|
||||
$after: String = null
|
||||
$filters: VideoFilterInput = null
|
||||
) {
|
||||
getUserVideos(limit: $limit, after: $after, filters: $filters) {
|
||||
videos {
|
||||
id
|
||||
name
|
||||
startTime
|
||||
stream {
|
||||
isCompleted
|
||||
lastIntendedSegmentBound
|
||||
uploadCompletionCursor
|
||||
}
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query GetUploadStreamDetails($videoId: Int!) {
|
||||
getVideo(videoId: $videoId) {
|
||||
|
@ -224,7 +224,7 @@ type UploadStreamGQL {
|
||||
linksRequested: Int!
|
||||
uploadsCompleted: Int!
|
||||
segmentProcessingCursor: Int!
|
||||
lastIntendedSegmentBound: Int!
|
||||
lastIntendedSegmentBound: Int
|
||||
isCompleted: Boolean!
|
||||
lowestUnuploadedSegmentIndex: Int!
|
||||
uploadCompletionCursor: Int!
|
||||
|
Loading…
Reference in New Issue
Block a user