From 7b51c317ca8592b856cc9b638c1e6f605b72c26c Mon Sep 17 00:00:00 2001 From: Loewy Date: Mon, 7 Jul 2025 13:12:36 -0700 Subject: [PATCH] add operation for ensureStripeCustomerExists --- src/index.tsx | 80 +++++++++++++++++++++++++++++++++++++ src/operations/payments.gql | 14 +++++++ 2 files changed, 94 insertions(+) create mode 100644 src/operations/payments.gql diff --git a/src/index.tsx b/src/index.tsx index 06ba72c..1ee7e1e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3834,6 +3834,27 @@ export type GetMedalsQuery = { }; }; +export type EnsureStripeCustomerExistsMutationVariables = Exact<{ + [key: string]: never; +}>; + +export type EnsureStripeCustomerExistsMutation = { + __typename?: "Mutation"; + ensureStripeCustomerExists: { + __typename?: "UserGQL"; + id: number; + firebaseUid?: string | null; + username: string; + stripeCustomerId?: string | null; + profileImageUri?: string | null; + isAdmin?: boolean | null; + fargoRating?: number | null; + videosPrivateByDefault?: boolean | null; + createdAt?: any | null; + updatedAt?: any | null; + }; +}; + export type ReactToVideoMutationVariables = Exact<{ videoId: Scalars["Int"]["input"]; reaction?: InputMaybe; @@ -6641,6 +6662,65 @@ export type GetMedalsQueryResult = Apollo.QueryResult< GetMedalsQuery, GetMedalsQueryVariables >; +export const EnsureStripeCustomerExistsDocument = gql` + mutation EnsureStripeCustomerExists { + ensureStripeCustomerExists { + id + firebaseUid + username + stripeCustomerId + profileImageUri + isAdmin + fargoRating + videosPrivateByDefault + createdAt + updatedAt + } + } +`; +export type EnsureStripeCustomerExistsMutationFn = Apollo.MutationFunction< + EnsureStripeCustomerExistsMutation, + EnsureStripeCustomerExistsMutationVariables +>; + +/** + * __useEnsureStripeCustomerExistsMutation__ + * + * To run a mutation, you first call `useEnsureStripeCustomerExistsMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useEnsureStripeCustomerExistsMutation` 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 [ensureStripeCustomerExistsMutation, { data, loading, error }] = useEnsureStripeCustomerExistsMutation({ + * variables: { + * }, + * }); + */ +export function useEnsureStripeCustomerExistsMutation( + baseOptions?: Apollo.MutationHookOptions< + EnsureStripeCustomerExistsMutation, + EnsureStripeCustomerExistsMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + EnsureStripeCustomerExistsMutation, + EnsureStripeCustomerExistsMutationVariables + >(EnsureStripeCustomerExistsDocument, options); +} +export type EnsureStripeCustomerExistsMutationHookResult = ReturnType< + typeof useEnsureStripeCustomerExistsMutation +>; +export type EnsureStripeCustomerExistsMutationResult = + Apollo.MutationResult; +export type EnsureStripeCustomerExistsMutationOptions = + Apollo.BaseMutationOptions< + EnsureStripeCustomerExistsMutation, + EnsureStripeCustomerExistsMutationVariables + >; 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 new file mode 100644 index 0000000..1648e62 --- /dev/null +++ b/src/operations/payments.gql @@ -0,0 +1,14 @@ +mutation EnsureStripeCustomerExists { + ensureStripeCustomerExists { + id + firebaseUid + username + stripeCustomerId + profileImageUri + isAdmin + fargoRating + videosPrivateByDefault + createdAt + updatedAt + } +}