Merge pull request 'Restore cursor from api' (#424) from loewy/restore-cursor-state-from-api into master

Reviewed-on: railbird/railbird-mobile#424
Reviewed-by: Ivan Malison <ivanmalison@gmail.com>
This commit is contained in:
Ivan Malison 2024-04-23 21:22:35 -06:00
commit ec1f5afb84
2 changed files with 224 additions and 0 deletions

View File

@ -814,6 +814,42 @@ export type EditUploadStreamMutation = {
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 }>;
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`
query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) {
getAggregatedShotMetrics(aggregateInput: $aggregateInput) {
@ -2087,3 +2123,165 @@ export type EditUploadStreamMutationOptions = Apollo.BaseMutationOptions<
EditUploadStreamMutation,
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
}
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,29 @@ mutation EditUploadStream(
) {
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
}
pageInfo {
hasNextPage
endCursor
}
}
}
query GetUploadStreamDetails($videoId: Int!) {
getVideo(videoId: $videoId) {
id
stream {
isCompleted
lowestUnuploadedSegmentIndex
}
}
}