Compare commits

...

3 Commits

Author SHA1 Message Date
6bd6cd4cce add username field to feed video fragment
All checks were successful
Tests / Tests (pull_request) Successful in 8s
2025-03-25 12:59:18 -07:00
31076957ef reactions operation 2025-03-25 12:56:03 -07:00
15c0849e4c Add support for video reaction
All checks were successful
Tests / Tests (pull_request) Successful in 6s
2025-03-21 11:15:29 -07:00
4 changed files with 136 additions and 0 deletions

View File

@ -2153,6 +2153,7 @@ export type Mutation = {
getHlsInitUploadLink: GetUploadLinkReturn;
getProfileImageUploadLink: GetProfileUploadLinkReturn;
getUploadLink: GetUploadLinkReturn;
reactToVideo: Scalars["Boolean"]["output"];
setLoggerLevel: Scalars["Boolean"]["output"];
setSegmentDuration: Scalars["Boolean"]["output"];
unfollowUser: UserGql;
@ -2217,6 +2218,11 @@ export type MutationGetUploadLinkArgs = {
videoId: Scalars["Int"]["input"];
};
export type MutationReactToVideoArgs = {
reaction?: InputMaybe<ReactionEnum>;
videoId: Scalars["Int"]["input"];
};
export type MutationSetLoggerLevelArgs = {
level: Scalars["String"]["input"];
path: Scalars["String"]["input"];
@ -2465,6 +2471,22 @@ export type QueryWaitForArgs = {
duration: Scalars["Float"]["input"];
};
export enum ReactionEnum {
Bullseye = "BULLSEYE",
Heart = "HEART",
Hundred = "HUNDRED",
Like = "LIKE",
}
export type ReactionGql = {
__typename?: "ReactionGQL";
createdAt?: Maybe<Scalars["DateTime"]["output"]>;
reaction: ReactionEnum;
updatedAt?: Maybe<Scalars["DateTime"]["output"]>;
user: UserGql;
videoId: Scalars["Int"]["output"];
};
export type RequestedMedalsGql = {
__typename?: "RequestedMedalsGQL";
dailyMakes50?: Maybe<MedalGql>;
@ -2899,6 +2921,7 @@ export type VideoGql = {
owner?: Maybe<UserGql>;
playlist?: Maybe<HlsPlaylistGql>;
private: Scalars["Boolean"]["output"];
reactions: Array<ReactionGql>;
screenshotUri?: Maybe<Scalars["String"]["output"]>;
shots: Array<ShotGql>;
startTime?: Maybe<Scalars["DateTime"]["output"]>;
@ -3086,6 +3109,12 @@ export type GetFeedQuery = {
status: ProcessingStatusEnum;
}>;
} | null;
reactions: Array<{
__typename?: "ReactionGQL";
videoId: number;
reaction: ReactionEnum;
user: { __typename?: "UserGQL"; id: number; username: string };
}>;
}>;
pageInfo: {
__typename?: "PageInfoGQL";
@ -3139,6 +3168,12 @@ export type VideoCardFieldsFragment = {
status: ProcessingStatusEnum;
}>;
} | null;
reactions: Array<{
__typename?: "ReactionGQL";
videoId: number;
reaction: ReactionEnum;
user: { __typename?: "UserGQL"; id: number; username: string };
}>;
};
export type GetVideoFeedQueryVariables = Exact<{
@ -3201,6 +3236,12 @@ export type GetVideoFeedQuery = {
status: ProcessingStatusEnum;
}>;
} | null;
reactions: Array<{
__typename?: "ReactionGQL";
videoId: number;
reaction: ReactionEnum;
user: { __typename?: "UserGQL"; id: number; username: string };
}>;
}>;
pageInfo: {
__typename?: "PageInfoGQL";
@ -3404,6 +3445,16 @@ export type GetMedalsQuery = {
};
};
export type ReactToVideoMutationVariables = Exact<{
videoId: Scalars["Int"]["input"];
reaction?: InputMaybe<ReactionEnum>;
}>;
export type ReactToVideoMutation = {
__typename?: "Mutation";
reactToVideo: boolean;
};
export type GetRunsForHighlightsQueryVariables = Exact<{
filterInput: RunFilterInput;
runIds?: InputMaybe<Array<Scalars["Int"]["input"]> | Scalars["Int"]["input"]>;
@ -4863,6 +4914,14 @@ export const VideoCardFieldsFragmentDoc = gql`
status
}
}
reactions {
videoId
user {
id
username
}
reaction
}
}
`;
export const MedalFieldsFragmentDoc = gql`
@ -5788,6 +5847,55 @@ export type GetMedalsQueryResult = Apollo.QueryResult<
GetMedalsQuery,
GetMedalsQueryVariables
>;
export const ReactToVideoDocument = gql`
mutation ReactToVideo($videoId: Int!, $reaction: ReactionEnum) {
reactToVideo(videoId: $videoId, reaction: $reaction)
}
`;
export type ReactToVideoMutationFn = Apollo.MutationFunction<
ReactToVideoMutation,
ReactToVideoMutationVariables
>;
/**
* __useReactToVideoMutation__
*
* To run a mutation, you first call `useReactToVideoMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useReactToVideoMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [reactToVideoMutation, { data, loading, error }] = useReactToVideoMutation({
* variables: {
* videoId: // value for 'videoId'
* reaction: // value for 'reaction'
* },
* });
*/
export function useReactToVideoMutation(
baseOptions?: Apollo.MutationHookOptions<
ReactToVideoMutation,
ReactToVideoMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<
ReactToVideoMutation,
ReactToVideoMutationVariables
>(ReactToVideoDocument, options);
}
export type ReactToVideoMutationHookResult = ReturnType<
typeof useReactToVideoMutation
>;
export type ReactToVideoMutationResult =
Apollo.MutationResult<ReactToVideoMutation>;
export type ReactToVideoMutationOptions = Apollo.BaseMutationOptions<
ReactToVideoMutation,
ReactToVideoMutationVariables
>;
export const GetRunsForHighlightsDocument = gql`
query GetRunsForHighlights(
$filterInput: RunFilterInput!

View File

@ -58,6 +58,14 @@ fragment VideoCardFields on VideoGQL {
status
}
}
reactions {
videoId
user {
id
username
}
reaction
}
}
query GetVideoFeed(

View File

@ -0,0 +1,3 @@
mutation ReactToVideo($videoId: Int!, $reaction: ReactionEnum) {
reactToVideo(videoId: $videoId, reaction: $reaction)
}

View File

@ -478,6 +478,7 @@ type VideoGQL {
currentHomography: HomographyInfoGQL
homographyHistory: [HomographyInfoGQL!]!
currentProcessing: VideoProcessingGQL
reactions: [ReactionGQL!]!
}
type UploadStreamGQL {
@ -611,6 +612,21 @@ type VideoProcessingStatusGQL {
updatedAt: DateTime
}
type ReactionGQL {
videoId: Int!
user: UserGQL!
reaction: ReactionEnum!
createdAt: DateTime
updatedAt: DateTime
}
enum ReactionEnum {
LIKE
HEART
BULLSEYE
HUNDRED
}
type RunFeaturesGQL {
runId: Int!
indexInRun: Int!
@ -797,6 +813,7 @@ type Mutation {
): Boolean!
editUploadStream(videoId: Int!, videoMetadata: VideoMetadataInput!): Boolean!
deleteVideo(videoId: Int!): Boolean!
reactToVideo(videoId: Int!, reaction: ReactionEnum): Boolean!
}
input CreateBucketSetInput {