Compare commits

..

4 Commits

Author SHA1 Message Date
051555f9fc Merge pull request 'Schema + Ops for Content Moderation GQL' (#201) from loewy/add-block-and-reporting-ops into master
Reviewed-on: #201
2025-09-30 15:58:59 -06:00
d7bbe882b7 Merge pull request 'Just schema changes, no operations' (#202) from loewy/blocking-and-reporting into master
Reviewed-on: #202
2025-09-30 15:58:51 -06:00
e783050a02 operations
All checks were successful
Tests / Tests (pull_request) Successful in 22s
2025-09-23 11:02:16 -07:00
d8ee83c627 codegen for reporting, user and content blocking
All checks were successful
Tests / Tests (pull_request) Successful in 8s
2025-09-17 20:00:25 -07:00
3 changed files with 236 additions and 0 deletions

View File

@@ -2277,6 +2277,8 @@ export type MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailed
export type Mutation = {
__typename?: "Mutation";
addAnnotationToShot: AddShotAnnotationReturn;
blockContent: Scalars["Boolean"]["output"];
blockUser: Scalars["Boolean"]["output"];
cancelSubscription: UserSubscriptionStatusGql;
commentOnVideo: Scalars["Boolean"]["output"];
createBucketSet: BucketSetGql;
@@ -2298,6 +2300,7 @@ export type Mutation = {
getProfileImageUploadLink: GetProfileUploadLinkReturn;
getUploadLink: GetUploadLinkReturn;
reactToVideo: Scalars["Boolean"]["output"];
reportContent: Scalars["Boolean"]["output"];
retireTags: Scalars["Boolean"]["output"];
setLoggerLevel: Scalars["Boolean"]["output"];
setSegmentDuration: Scalars["Boolean"]["output"];
@@ -2311,6 +2314,14 @@ export type MutationAddAnnotationToShotArgs = {
shotId: Scalars["Int"]["input"];
};
export type MutationBlockContentArgs = {
videoId: Scalars["Int"]["input"];
};
export type MutationBlockUserArgs = {
userId: Scalars["Int"]["input"];
};
export type MutationCommentOnVideoArgs = {
message: Scalars["String"]["input"];
parentCommentId?: InputMaybe<Scalars["Int"]["input"]>;
@@ -2394,6 +2405,12 @@ export type MutationReactToVideoArgs = {
videoId: Scalars["Int"]["input"];
};
export type MutationReportContentArgs = {
customReason?: InputMaybe<Scalars["String"]["input"]>;
reason: ReportReasonEnum;
videoId: Scalars["Int"]["input"];
};
export type MutationRetireTagsArgs = {
tagIds: Array<Scalars["Int"]["input"]>;
};
@@ -2691,6 +2708,15 @@ export type ReactionGql = {
videoId: Scalars["Int"]["output"];
};
export enum ReportReasonEnum {
Copyright = "COPYRIGHT",
Hate = "HATE",
Nudity = "NUDITY",
Other = "OTHER",
Spam = "SPAM",
Violence = "VIOLENCE",
}
export type RequestedMedalsGql = {
__typename?: "RequestedMedalsGQL";
dailyMakes50?: Maybe<MedalGql>;
@@ -3357,6 +3383,32 @@ export type GetDeployedConfigQuery = {
};
};
export type BlockContentMutationVariables = Exact<{
videoId: Scalars["Int"]["input"];
}>;
export type BlockContentMutation = {
__typename?: "Mutation";
blockContent: boolean;
};
export type BlockUserMutationVariables = Exact<{
userId: Scalars["Int"]["input"];
}>;
export type BlockUserMutation = { __typename?: "Mutation"; blockUser: boolean };
export type ReportContentMutationVariables = Exact<{
videoId: Scalars["Int"]["input"];
reason: ReportReasonEnum;
customReason?: InputMaybe<Scalars["String"]["input"]>;
}>;
export type ReportContentMutation = {
__typename?: "Mutation";
reportContent: boolean;
};
export type GetFeedQueryVariables = Exact<{
limit?: Scalars["Int"]["input"];
after?: InputMaybe<Scalars["String"]["input"]>;
@@ -6251,6 +6303,159 @@ export type GetDeployedConfigQueryResult = Apollo.QueryResult<
GetDeployedConfigQuery,
GetDeployedConfigQueryVariables
>;
export const BlockContentDocument = gql`
mutation blockContent($videoId: Int!) {
blockContent(videoId: $videoId)
}
`;
export type BlockContentMutationFn = Apollo.MutationFunction<
BlockContentMutation,
BlockContentMutationVariables
>;
/**
* __useBlockContentMutation__
*
* To run a mutation, you first call `useBlockContentMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useBlockContentMutation` 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 [blockContentMutation, { data, loading, error }] = useBlockContentMutation({
* variables: {
* videoId: // value for 'videoId'
* },
* });
*/
export function useBlockContentMutation(
baseOptions?: Apollo.MutationHookOptions<
BlockContentMutation,
BlockContentMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<
BlockContentMutation,
BlockContentMutationVariables
>(BlockContentDocument, options);
}
export type BlockContentMutationHookResult = ReturnType<
typeof useBlockContentMutation
>;
export type BlockContentMutationResult =
Apollo.MutationResult<BlockContentMutation>;
export type BlockContentMutationOptions = Apollo.BaseMutationOptions<
BlockContentMutation,
BlockContentMutationVariables
>;
export const BlockUserDocument = gql`
mutation blockUser($userId: Int!) {
blockUser(userId: $userId)
}
`;
export type BlockUserMutationFn = Apollo.MutationFunction<
BlockUserMutation,
BlockUserMutationVariables
>;
/**
* __useBlockUserMutation__
*
* To run a mutation, you first call `useBlockUserMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useBlockUserMutation` 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 [blockUserMutation, { data, loading, error }] = useBlockUserMutation({
* variables: {
* userId: // value for 'userId'
* },
* });
*/
export function useBlockUserMutation(
baseOptions?: Apollo.MutationHookOptions<
BlockUserMutation,
BlockUserMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<BlockUserMutation, BlockUserMutationVariables>(
BlockUserDocument,
options,
);
}
export type BlockUserMutationHookResult = ReturnType<
typeof useBlockUserMutation
>;
export type BlockUserMutationResult = Apollo.MutationResult<BlockUserMutation>;
export type BlockUserMutationOptions = Apollo.BaseMutationOptions<
BlockUserMutation,
BlockUserMutationVariables
>;
export const ReportContentDocument = gql`
mutation reportContent(
$videoId: Int!
$reason: ReportReasonEnum!
$customReason: String = null
) {
reportContent(
videoId: $videoId
reason: $reason
customReason: $customReason
)
}
`;
export type ReportContentMutationFn = Apollo.MutationFunction<
ReportContentMutation,
ReportContentMutationVariables
>;
/**
* __useReportContentMutation__
*
* To run a mutation, you first call `useReportContentMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useReportContentMutation` 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 [reportContentMutation, { data, loading, error }] = useReportContentMutation({
* variables: {
* videoId: // value for 'videoId'
* reason: // value for 'reason'
* customReason: // value for 'customReason'
* },
* });
*/
export function useReportContentMutation(
baseOptions?: Apollo.MutationHookOptions<
ReportContentMutation,
ReportContentMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<
ReportContentMutation,
ReportContentMutationVariables
>(ReportContentDocument, options);
}
export type ReportContentMutationHookResult = ReturnType<
typeof useReportContentMutation
>;
export type ReportContentMutationResult =
Apollo.MutationResult<ReportContentMutation>;
export type ReportContentMutationOptions = Apollo.BaseMutationOptions<
ReportContentMutation,
ReportContentMutationVariables
>;
export const GetFeedDocument = gql`
query GetFeed(
$limit: Int! = 5

View File

@@ -0,0 +1,15 @@
mutation blockContent($videoId: Int!) {
blockContent(videoId: $videoId)
}
mutation blockUser($userId: Int!) {
blockUser(userId: $userId)
}
mutation reportContent(
$videoId: Int!
$reason: ReportReasonEnum!
$customReason: String = null
) {
reportContent(videoId: $videoId, reason: $reason, customReason: $customReason)
}

View File

@@ -907,6 +907,13 @@ type Mutation {
): Boolean!
editComment(videoId: Int!, commentId: Int!, newMessage: String!): Boolean!
deleteComment(videoId: Int!, commentId: Int!): Boolean!
blockContent(videoId: Int!): Boolean!
blockUser(userId: Int!): Boolean!
reportContent(
videoId: Int!
reason: ReportReasonEnum!
customReason: String = null
): Boolean!
addAnnotationToShot(
shotId: Int!
annotationName: String!
@@ -954,6 +961,15 @@ input CreateBucketSetInput {
buckets: [BucketInputGQL!]!
}
enum ReportReasonEnum {
SPAM
NUDITY
VIOLENCE
HATE
COPYRIGHT
OTHER
}
type AddShotAnnotationReturn {
value: SuccessfulAddAddShotAnnotationErrors!
}