From b2ce1c2f96e77caa727536bd8d1c466b8be92b65 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Tue, 5 Nov 2024 13:56:51 -0700 Subject: [PATCH 1/2] Create video card fragment --- src/index.tsx | 91 +++++++++++++++++++++++++++++------------ src/operations/feed.gql | 59 ++++++++++++++------------ 2 files changed, 96 insertions(+), 54 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index e52727f..dd39fca 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2786,6 +2786,37 @@ export type GetFeedQuery = { }; }; +export type VideoCardFieldsFragment = { + __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; + profileImageUri?: string | null; + } | null; + stream?: { + __typename?: "UploadStreamGQL"; + id: string; + isCompleted: boolean; + } | null; + tags: Array<{ + __typename?: "VideoTag"; + name: string; + tagClasses: Array<{ __typename?: "VideoTagClass"; name: string }>; + }>; +}; + export type GetVideoFeedQueryVariables = Exact<{ limit?: Scalars["Int"]["input"]; after?: InputMaybe; @@ -3956,6 +3987,37 @@ export type GetUploadStreamsWithDetailsQuery = { }; }; +export const VideoCardFieldsFragmentDoc = gql` + fragment VideoCardFields on VideoGQL { + id + owner { + username + profileImageUri + } + name + screenshotUri + totalShotsMade + totalShots + makePercentage + createdAt + updatedAt + startTime + endTime + elapsedTime + screenshotUri + stream { + id + isCompleted + } + tableSize + tags { + tagClasses { + name + } + name + } + } +`; export const ShotWithAllFeaturesFragmentDoc = gql` fragment ShotWithAllFeatures on ShotGQL { id @@ -4341,33 +4403,7 @@ export const GetVideoFeedDocument = gql` ) { getFeedVideos(limit: $limit, after: $after, filters: $filters) { videos { - id - owner { - username - profileImageUri - } - name - screenshotUri - totalShotsMade - totalShots - makePercentage - createdAt - updatedAt - startTime - endTime - elapsedTime - screenshotUri - stream { - id - isCompleted - } - tableSize - tags { - tagClasses { - name - } - name - } + ...VideoCardFields } pageInfo { hasNextPage @@ -4375,6 +4411,7 @@ export const GetVideoFeedDocument = gql` } } } + ${VideoCardFieldsFragmentDoc} `; /** diff --git a/src/operations/feed.gql b/src/operations/feed.gql index f9079ce..367f495 100644 --- a/src/operations/feed.gql +++ b/src/operations/feed.gql @@ -1,3 +1,4 @@ +# DO NOT USE: use getVideoFeed instead query GetFeed( $limit: Int! = 5 $after: String = null @@ -39,6 +40,36 @@ query GetFeed( } } +fragment VideoCardFields on VideoGQL { + id + owner { + username + profileImageUri + } + name + screenshotUri + totalShotsMade + totalShots + makePercentage + createdAt + updatedAt + startTime + endTime + elapsedTime + screenshotUri + stream { + id + isCompleted + } + tableSize + tags { + tagClasses { + name + } + name + } +} + query GetVideoFeed( $limit: Int! = 5 $after: String = null @@ -46,33 +77,7 @@ query GetVideoFeed( ) { getFeedVideos(limit: $limit, after: $after, filters: $filters) { videos { - id - owner { - username - profileImageUri - } - name - screenshotUri - totalShotsMade - totalShots - makePercentage - createdAt - updatedAt - startTime - endTime - elapsedTime - screenshotUri - stream { - id - isCompleted - } - tableSize - tags { - tagClasses { - name - } - name - } + ...VideoCardFields } pageInfo { hasNextPage From c7642e6204c1d37adcc79fc17d2dfb12ec439aa9 Mon Sep 17 00:00:00 2001 From: Kat Huang Date: Tue, 5 Nov 2024 13:58:31 -0700 Subject: [PATCH 2/2] Create video card fragment --- src/index.tsx | 3 +++ src/operations/feed.gql | 1 + 2 files changed, 4 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index dd39fca..091e5d1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2802,6 +2802,7 @@ export type VideoCardFieldsFragment = { tableSize: number; owner?: { __typename?: "UserGQL"; + id: number; username: string; profileImageUri?: string | null; } | null; @@ -2843,6 +2844,7 @@ export type GetVideoFeedQuery = { tableSize: number; owner?: { __typename?: "UserGQL"; + id: number; username: string; profileImageUri?: string | null; } | null; @@ -3991,6 +3993,7 @@ export const VideoCardFieldsFragmentDoc = gql` fragment VideoCardFields on VideoGQL { id owner { + id username profileImageUri } diff --git a/src/operations/feed.gql b/src/operations/feed.gql index 367f495..047bdf8 100644 --- a/src/operations/feed.gql +++ b/src/operations/feed.gql @@ -43,6 +43,7 @@ query GetFeed( fragment VideoCardFields on VideoGQL { id owner { + id username profileImageUri }