reactions operation

This commit is contained in:
Loewy 2025-03-25 12:56:03 -07:00
parent e0607dfbf6
commit dd214b5502
3 changed files with 94 additions and 0 deletions

View File

@ -3210,6 +3210,12 @@ export type GetFeedQuery = {
status: ProcessingStatusEnum;
}>;
} | null;
reactions: Array<{
__typename?: "ReactionGQL";
videoId: number;
reaction: ReactionEnum;
user: { __typename?: "UserGQL"; id: number };
}>;
}>;
pageInfo: {
__typename?: "PageInfoGQL";
@ -3263,6 +3269,12 @@ export type VideoCardFieldsFragment = {
status: ProcessingStatusEnum;
}>;
} | null;
reactions: Array<{
__typename?: "ReactionGQL";
videoId: number;
reaction: ReactionEnum;
user: { __typename?: "UserGQL"; id: number };
}>;
};
export type GetVideoFeedQueryVariables = Exact<{
@ -3325,6 +3337,12 @@ export type GetVideoFeedQuery = {
status: ProcessingStatusEnum;
}>;
} | null;
reactions: Array<{
__typename?: "ReactionGQL";
videoId: number;
reaction: ReactionEnum;
user: { __typename?: "UserGQL"; id: number };
}>;
}>;
pageInfo: {
__typename?: "PageInfoGQL";
@ -3528,6 +3546,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"]>;
@ -4996,6 +5024,13 @@ export const VideoCardFieldsFragmentDoc = gql`
status
}
}
reactions {
videoId
user {
id
}
reaction
}
}
`;
export const MedalFieldsFragmentDoc = gql`
@ -5921,6 +5956,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,13 @@ fragment VideoCardFields on VideoGQL {
status
}
}
reactions {
videoId
user {
id
}
reaction
}
}
query GetVideoFeed(

View File

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