From f5e64598828852f44d0b5bc042968c844bb24c39 Mon Sep 17 00:00:00 2001 From: Loewy Date: Tue, 16 Dec 2025 16:51:08 -0800 Subject: [PATCH] add schema and operations for submit cancellation feedback, along with associated enum --- src/index.tsx | 88 +++++++++++++++++++++++++++++++++++++ src/operations/payments.gql | 7 +++ src/schema.gql | 20 +++++++++ 3 files changed, 115 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index 658394c..9b463dd 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -140,6 +140,21 @@ export type BucketSetInputGql = { feature: Scalars["String"]["input"]; }; +export type CancellationFeedbackMetadataInput = { + appVersion?: InputMaybe; + gitRevision?: InputMaybe; + platform?: InputMaybe; +}; + +export enum CancellationReasonEnum { + DataNotAccurate = "DATA_NOT_ACCURATE", + DontPlayEnough = "DONT_PLAY_ENOUGH", + MissingFeatures = "MISSING_FEATURES", + Other = "OTHER", + TechnicalIssues = "TECHNICAL_ISSUES", + TooExpensive = "TOO_EXPENSIVE", +} + export type Challenge = { __typename?: "Challenge"; createdAt: Scalars["DateTime"]["output"]; @@ -2361,6 +2376,7 @@ export type Mutation = { setLoggerLevel: Scalars["Boolean"]["output"]; setSegmentDuration: Scalars["Boolean"]["output"]; startChallenge: ChallengeEntry; + submitCancellationFeedback: Scalars["Boolean"]["output"]; submitChallengeEntry: ChallengeEntry; undismissChallenge: Scalars["Boolean"]["output"]; unfollowUser: UserGql; @@ -2537,6 +2553,12 @@ export type MutationStartChallengeArgs = { challengeId: Scalars["ID"]["input"]; }; +export type MutationSubmitCancellationFeedbackArgs = { + feedback?: InputMaybe; + metadata?: InputMaybe; + reasons?: InputMaybe>; +}; + export type MutationSubmitChallengeEntryArgs = { entryId: Scalars["ID"]["input"]; videoId: Scalars["ID"]["input"]; @@ -4707,6 +4729,17 @@ export type CancelSubscriptionMutation = { }; }; +export type SubmitCancellationFeedbackMutationVariables = Exact<{ + reasons?: InputMaybe | CancellationReasonEnum>; + feedback?: InputMaybe; + metadata?: InputMaybe; +}>; + +export type SubmitCancellationFeedbackMutation = { + __typename?: "Mutation"; + submitCancellationFeedback: boolean; +}; + export type ReactToVideoMutationVariables = Exact<{ videoId: Scalars["Int"]["input"]; reaction?: InputMaybe; @@ -9644,6 +9677,61 @@ export type CancelSubscriptionMutationOptions = Apollo.BaseMutationOptions< CancelSubscriptionMutation, CancelSubscriptionMutationVariables >; +export const SubmitCancellationFeedbackDocument = gql` + mutation SubmitCancellationFeedback( + $reasons: [CancellationReasonEnum!] + $feedback: String + $metadata: CancellationFeedbackMetadataInput + ) { + submitCancellationFeedback(reasons: $reasons, feedback: $feedback) + } +`; +export type SubmitCancellationFeedbackMutationFn = Apollo.MutationFunction< + SubmitCancellationFeedbackMutation, + SubmitCancellationFeedbackMutationVariables +>; + +/** + * __useSubmitCancellationFeedbackMutation__ + * + * To run a mutation, you first call `useSubmitCancellationFeedbackMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useSubmitCancellationFeedbackMutation` 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 [submitCancellationFeedbackMutation, { data, loading, error }] = useSubmitCancellationFeedbackMutation({ + * variables: { + * reasons: // value for 'reasons' + * feedback: // value for 'feedback' + * metadata: // value for 'metadata' + * }, + * }); + */ +export function useSubmitCancellationFeedbackMutation( + baseOptions?: Apollo.MutationHookOptions< + SubmitCancellationFeedbackMutation, + SubmitCancellationFeedbackMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + SubmitCancellationFeedbackMutation, + SubmitCancellationFeedbackMutationVariables + >(SubmitCancellationFeedbackDocument, options); +} +export type SubmitCancellationFeedbackMutationHookResult = ReturnType< + typeof useSubmitCancellationFeedbackMutation +>; +export type SubmitCancellationFeedbackMutationResult = + Apollo.MutationResult; +export type SubmitCancellationFeedbackMutationOptions = + Apollo.BaseMutationOptions< + SubmitCancellationFeedbackMutation, + SubmitCancellationFeedbackMutationVariables + >; export const ReactToVideoDocument = gql` mutation ReactToVideo($videoId: Int!, $reaction: ReactionEnum) { reactToVideo(videoId: $videoId, reaction: $reaction) diff --git a/src/operations/payments.gql b/src/operations/payments.gql index 1637d50..1d5fafa 100644 --- a/src/operations/payments.gql +++ b/src/operations/payments.gql @@ -63,3 +63,10 @@ mutation CancelSubscription { stripeSubscriptionId } } +mutation SubmitCancellationFeedback( + $reasons: [CancellationReasonEnum!] + $feedback: String + $metadata: CancellationFeedbackMetadataInput +) { + submitCancellationFeedback(reasons: $reasons, feedback: $feedback) +} diff --git a/src/schema.gql b/src/schema.gql index 7f63751..fabc401 100644 --- a/src/schema.gql +++ b/src/schema.gql @@ -1072,6 +1072,11 @@ type Mutation { deleteUser: Boolean! createSubscription(priceId: String!): CreateSubscriptionResultGQL! cancelSubscription: UserSubscriptionStatusGQL! + submitCancellationFeedback( + reasons: [CancellationReasonEnum!] = null + feedback: String = null + metadata: CancellationFeedbackMetadataInput = null + ): Boolean! findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL createUploadStream( videoMetadata: VideoMetadataInput! @@ -1196,6 +1201,21 @@ type CreateSubscriptionResultGQL { sessionId: String! } +enum CancellationReasonEnum { + DONT_PLAY_ENOUGH + TOO_EXPENSIVE + MISSING_FEATURES + TECHNICAL_ISSUES + DATA_NOT_ACCURATE + OTHER +} + +input CancellationFeedbackMetadataInput { + appVersion: String = null + gitRevision: String = null + platform: String = null +} + type CreateUploadStreamReturn { videoId: Int! }