From 9d0ba908dc6fab2727a800027dc08850ede69b02 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 17 Dec 2024 17:35:38 -0700 Subject: [PATCH] Generalize getFeed --- src/index.tsx | 26 +++++++++++++++++++++++++- src/schema.gql | 15 ++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index a1b647f..cf637ca 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1981,6 +1981,12 @@ export type HomographyInfoGql = { sourcePoints: PocketPointsGql; }; +export enum IncludePrivateEnum { + All = "ALL", + Mine = "MINE", + None = "NONE", +} + export enum InitPlaylistUploadStatusEnum { NotApplicable = "NOT_APPLICABLE", NotUploaded = "NOT_UPLOADED", @@ -2259,9 +2265,10 @@ export type QueryGetBucketSetArgs = { export type QueryGetFeedVideosArgs = { after?: InputMaybe; - allVideos?: Scalars["Boolean"]["input"]; + feedInput?: InputMaybe; filters?: InputMaybe; includeCallersVideos?: InputMaybe; + includePrivate?: IncludePrivateEnum; limit?: Scalars["Int"]["input"]; }; @@ -2710,6 +2717,23 @@ export type UserRelationshipsResult = { relationships: Array; }; +export type VideoFeedInputGql = + | { + allUsers: Scalars["Boolean"]["input"]; + followedByUserId?: never; + userId?: never; + } + | { + allUsers?: never; + followedByUserId: Scalars["Int"]["input"]; + userId?: never; + } + | { + allUsers?: never; + followedByUserId?: never; + userId: Scalars["Int"]["input"]; + }; + export type VideoFilterInput = { createdAt?: InputMaybe; excludeVideosWithNoShots?: InputMaybe; diff --git a/src/schema.gql b/src/schema.gql index 80c9917..dc4f661 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -66,9 +66,10 @@ type Query { getFeedVideos( limit: Int! = 5 after: String = null + includePrivate: IncludePrivateEnum! = MINE includeCallersVideos: Boolean = true filters: VideoFilterInput = null - allVideos: Boolean! = false + feedInput: VideoFeedInputGQL = null ): VideoHistoryGQL! } @@ -706,6 +707,18 @@ scalar JSON url: "https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf" ) +enum IncludePrivateEnum { + ALL + MINE + NONE +} + +input VideoFeedInputGQL @oneOf { + followedByUserId: Int + userId: Int + allUsers: Boolean +} + type Mutation { createBucketSet(params: CreateBucketSetInput!): BucketSetGQL! setLoggerLevel(path: String!, level: String!): Boolean!