From 0421be855d9486e33f5fd5264a827a31c56e5340 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Mon, 4 Nov 2024 15:08:21 -0700 Subject: [PATCH] Create new get feed operation --- src/index.tsx | 154 ++++++++++++++++++++++++++++++++++++++++ src/operations/feed.gql | 41 +++++++++++ 2 files changed, 195 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index f159f47..ace2db4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2786,6 +2786,50 @@ export type GetFeedQuery = { }; }; +export type GetVideoFeedQueryVariables = Exact<{ + limit?: Scalars["Int"]["input"]; + after?: InputMaybe; + filters?: InputMaybe; +}>; + +export type GetVideoFeedQuery = { + __typename?: "Query"; + getFeedVideos: { + __typename?: "VideoHistoryGQL"; + videos: Array<{ + __typename?: "VideoGQL"; + id: number; + name?: string | null; + screenshotUri?: string | null; + totalShotsMade: number; + totalShots: number; + makePercentage: number; + createdAt?: any | null; + updatedAt?: any | null; + startTime?: any | null; + endTime?: any | null; + elapsedTime?: number | null; + tableSize: number; + owner?: { __typename?: "UserGQL"; username: string } | null; + stream?: { + __typename?: "UploadStreamGQL"; + id: string; + isCompleted: boolean; + } | null; + tags: Array<{ + __typename?: "VideoTag"; + name: string; + tagClasses: Array<{ __typename?: "VideoTagClass"; name: string }>; + }>; + }>; + pageInfo: { + __typename?: "PageInfoGQL"; + hasNextPage: boolean; + endCursor?: string | null; + }; + }; +}; + export type GetVideoMakePercentageIntervalsQueryVariables = Exact<{ videoId: Scalars["ID"]["input"]; intervalDuration: Scalars["Int"]["input"]; @@ -4285,6 +4329,116 @@ export type GetFeedQueryResult = Apollo.QueryResult< GetFeedQuery, GetFeedQueryVariables >; +export const GetVideoFeedDocument = gql` + query GetVideoFeed( + $limit: Int! = 5 + $after: String = null + $filters: VideoFilterInput = null + ) { + getFeedVideos(limit: $limit, after: $after, filters: $filters) { + videos { + id + owner { + username + } + name + screenshotUri + totalShotsMade + totalShots + makePercentage + createdAt + updatedAt + startTime + endTime + elapsedTime + screenshotUri + stream { + id + isCompleted + } + tableSize + tags { + tagClasses { + name + } + name + } + } + pageInfo { + hasNextPage + endCursor + } + } + } +`; + +/** + * __useGetVideoFeedQuery__ + * + * To run a query within a React component, call `useGetVideoFeedQuery` and pass it any options that fit your needs. + * When your component renders, `useGetVideoFeedQuery` 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 } = useGetVideoFeedQuery({ + * variables: { + * limit: // value for 'limit' + * after: // value for 'after' + * filters: // value for 'filters' + * }, + * }); + */ +export function useGetVideoFeedQuery( + baseOptions?: Apollo.QueryHookOptions< + GetVideoFeedQuery, + GetVideoFeedQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useQuery( + GetVideoFeedDocument, + options, + ); +} +export function useGetVideoFeedLazyQuery( + baseOptions?: Apollo.LazyQueryHookOptions< + GetVideoFeedQuery, + GetVideoFeedQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useLazyQuery( + GetVideoFeedDocument, + options, + ); +} +export function useGetVideoFeedSuspenseQuery( + baseOptions?: Apollo.SuspenseQueryHookOptions< + GetVideoFeedQuery, + GetVideoFeedQueryVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useSuspenseQuery( + GetVideoFeedDocument, + options, + ); +} +export type GetVideoFeedQueryHookResult = ReturnType< + typeof useGetVideoFeedQuery +>; +export type GetVideoFeedLazyQueryHookResult = ReturnType< + typeof useGetVideoFeedLazyQuery +>; +export type GetVideoFeedSuspenseQueryHookResult = ReturnType< + typeof useGetVideoFeedSuspenseQuery +>; +export type GetVideoFeedQueryResult = Apollo.QueryResult< + GetVideoFeedQuery, + GetVideoFeedQueryVariables +>; export const GetVideoMakePercentageIntervalsDocument = gql` query GetVideoMakePercentageIntervals( $videoId: ID! diff --git a/src/operations/feed.gql b/src/operations/feed.gql index 80814e5..fbbb7c8 100644 --- a/src/operations/feed.gql +++ b/src/operations/feed.gql @@ -38,3 +38,44 @@ query GetFeed( } } } + +query GetVideoFeed( + $limit: Int! = 5 + $after: String = null + $filters: VideoFilterInput = null +) { + getFeedVideos(limit: $limit, after: $after, filters: $filters) { + videos { + id + owner { + username + } + name + screenshotUri + totalShotsMade + totalShots + makePercentage + createdAt + updatedAt + startTime + endTime + elapsedTime + screenshotUri + stream { + id + isCompleted + } + tableSize + tags { + tagClasses { + name + } + name + } + } + pageInfo { + hasNextPage + endCursor + } + } +} -- 2.46.1