Add pagination to getShots

This commit is contained in:
Ivan Malison 2024-08-01 19:49:57 -06:00
parent 04308b1003
commit c18628a4ca
2 changed files with 37 additions and 10 deletions

View File

@ -102,6 +102,10 @@ export type CreateUploadStreamReturn = {
videoId: Scalars["Int"]["output"]; videoId: Scalars["Int"]["output"];
}; };
export type CreatedAfter =
| { createdAt: Scalars["DateTime"]["input"]; videoId?: never }
| { createdAt?: never; videoId: Scalars["Int"]["input"] };
export type CueObjectFeaturesGql = { export type CueObjectFeaturesGql = {
__typename?: "CueObjectFeaturesGQL"; __typename?: "CueObjectFeaturesGQL";
cueBallSpeed?: Maybe<Scalars["Float"]["output"]>; cueBallSpeed?: Maybe<Scalars["Float"]["output"]>;
@ -1029,6 +1033,11 @@ export type FilterInput =
videoId: Array<Scalars["Int"]["input"]>; videoId: Array<Scalars["Int"]["input"]>;
}; };
export type GetShotsPagination = {
createdAfter: CreatedAfter;
startFrameAfter: Scalars["Int"]["input"];
};
export type GetUploadLinkReturn = { export type GetUploadLinkReturn = {
__typename?: "GetUploadLinkReturn"; __typename?: "GetUploadLinkReturn";
headers: Array<Maybe<Header>>; headers: Array<Maybe<Header>>;
@ -1201,6 +1210,8 @@ export type QueryGetPlayTimeArgs = {
export type QueryGetShotsArgs = { export type QueryGetShotsArgs = {
filterInput: FilterInput; filterInput: FilterInput;
limit?: Scalars["Int"]["input"];
shotsPagination?: InputMaybe<GetShotsPagination>;
}; };
export type QueryGetUserArgs = { export type QueryGetUserArgs = {
@ -1284,6 +1295,7 @@ export type ShotGql = {
startFrame: Scalars["Int"]["output"]; startFrame: Scalars["Int"]["output"];
updatedAt?: Maybe<Scalars["DateTime"]["output"]>; updatedAt?: Maybe<Scalars["DateTime"]["output"]>;
user?: Maybe<UserGql>; user?: Maybe<UserGql>;
video?: Maybe<VideoGql>;
videoId: Scalars["Int"]["output"]; videoId: Scalars["Int"]["output"];
}; };

View File

@ -8,7 +8,11 @@ type Query {
videoId: ID! videoId: ID!
intervalDuration: Int! = 300 intervalDuration: Int! = 300
): [MakePercentageIntervalGQL!]! ): [MakePercentageIntervalGQL!]!
getShots(filterInput: FilterInput!): [ShotGQL!]! getShots(
filterInput: FilterInput!
shotsPagination: GetShotsPagination = null
limit: Int! = 10
): [ShotGQL!]!
getShotAnnotationTypes: [ShotAnnotationTypeGQL!]! getShotAnnotationTypes: [ShotAnnotationTypeGQL!]!
getUser(userId: Int!): UserGQL getUser(userId: Int!): UserGQL
getLoggedInUser: UserGQL getLoggedInUser: UserGQL
@ -168,6 +172,7 @@ type ShotGQL {
user: UserGQL user: UserGQL
annotations: [ShotAnnotationGQL!]! annotations: [ShotAnnotationGQL!]!
falsePositiveScore: Float falsePositiveScore: Float
video: VideoGQL
} }
""" """
@ -229,15 +234,6 @@ type ShotAnnotationTypeGQL {
name: String! name: String!
} }
type UserPlayTimeGQL {
totalSeconds: Float!
}
type VideoHistoryGQL {
videos: [VideoGQL!]!
pageInfo: PageInfoGQL!
}
type VideoGQL { type VideoGQL {
id: Int! id: Int!
owner: UserGQL owner: UserGQL
@ -364,6 +360,25 @@ type VideoProcessingErrorGQL {
endSegmentIndex: Int endSegmentIndex: Int
} }
input GetShotsPagination {
createdAfter: CreatedAfter!
startFrameAfter: Int!
}
input CreatedAfter @oneOf {
videoId: Int
createdAt: DateTime
}
type UserPlayTimeGQL {
totalSeconds: Float!
}
type VideoHistoryGQL {
videos: [VideoGQL!]!
pageInfo: PageInfoGQL!
}
type PageInfoGQL { type PageInfoGQL {
hasNextPage: Boolean! hasNextPage: Boolean!
endCursor: String endCursor: String