Add operations for user subscriptions #199
169
src/index.tsx
169
src/index.tsx
@ -3962,6 +3962,42 @@ export type GetAvailableSubscriptionOptionsQuery = {
|
||||
};
|
||||
};
|
||||
|
||||
export type GetSubscriptionStatusQueryVariables = Exact<{
|
||||
[key: string]: never;
|
||||
}>;
|
||||
|
||||
export type GetSubscriptionStatusQuery = {
|
||||
__typename?: "Query";
|
||||
getUserSubscriptionStatus: {
|
||||
__typename?: "UserSubscriptionStatusGQL";
|
||||
hasActiveSubscription: boolean;
|
||||
subscriptionStatus?: StripeSubscriptionStatusEnum | null;
|
||||
currentPeriodStart?: any | null;
|
||||
currentPeriodEnd?: any | null;
|
||||
validUntil?: any | null;
|
||||
stripePriceId?: string | null;
|
||||
stripeSubscriptionId?: string | null;
|
||||
};
|
||||
};
|
||||
|
||||
export type CancelSubscriptionMutationVariables = Exact<{
|
||||
[key: string]: never;
|
||||
}>;
|
||||
|
||||
export type CancelSubscriptionMutation = {
|
||||
__typename?: "Mutation";
|
||||
cancelSubscription: {
|
||||
__typename?: "UserSubscriptionStatusGQL";
|
||||
hasActiveSubscription: boolean;
|
||||
subscriptionStatus?: StripeSubscriptionStatusEnum | null;
|
||||
currentPeriodStart?: any | null;
|
||||
currentPeriodEnd?: any | null;
|
||||
validUntil?: any | null;
|
||||
stripePriceId?: string | null;
|
||||
stripeSubscriptionId?: string | null;
|
||||
};
|
||||
};
|
||||
|
||||
export type ReactToVideoMutationVariables = Exact<{
|
||||
videoId: Scalars["Int"]["input"];
|
||||
reaction?: InputMaybe<ReactionEnum>;
|
||||
@ -6972,6 +7008,139 @@ export type GetAvailableSubscriptionOptionsQueryResult = Apollo.QueryResult<
|
||||
GetAvailableSubscriptionOptionsQuery,
|
||||
GetAvailableSubscriptionOptionsQueryVariables
|
||||
>;
|
||||
export const GetSubscriptionStatusDocument = gql`
|
||||
query GetSubscriptionStatus {
|
||||
getUserSubscriptionStatus {
|
||||
hasActiveSubscription
|
||||
subscriptionStatus
|
||||
currentPeriodStart
|
||||
currentPeriodEnd
|
||||
validUntil
|
||||
stripePriceId
|
||||
stripeSubscriptionId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useGetSubscriptionStatusQuery__
|
||||
*
|
||||
* To run a query within a React component, call `useGetSubscriptionStatusQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useGetSubscriptionStatusQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||
*
|
||||
* @example
|
||||
* const { data, loading, error } = useGetSubscriptionStatusQuery({
|
||||
* variables: {
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useGetSubscriptionStatusQuery(
|
||||
baseOptions?: Apollo.QueryHookOptions<
|
||||
GetSubscriptionStatusQuery,
|
||||
GetSubscriptionStatusQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useQuery<
|
||||
GetSubscriptionStatusQuery,
|
||||
GetSubscriptionStatusQueryVariables
|
||||
>(GetSubscriptionStatusDocument, options);
|
||||
}
|
||||
export function useGetSubscriptionStatusLazyQuery(
|
||||
baseOptions?: Apollo.LazyQueryHookOptions<
|
||||
GetSubscriptionStatusQuery,
|
||||
GetSubscriptionStatusQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useLazyQuery<
|
||||
GetSubscriptionStatusQuery,
|
||||
GetSubscriptionStatusQueryVariables
|
||||
>(GetSubscriptionStatusDocument, options);
|
||||
}
|
||||
export function useGetSubscriptionStatusSuspenseQuery(
|
||||
baseOptions?: Apollo.SuspenseQueryHookOptions<
|
||||
GetSubscriptionStatusQuery,
|
||||
GetSubscriptionStatusQueryVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useSuspenseQuery<
|
||||
GetSubscriptionStatusQuery,
|
||||
GetSubscriptionStatusQueryVariables
|
||||
>(GetSubscriptionStatusDocument, options);
|
||||
}
|
||||
export type GetSubscriptionStatusQueryHookResult = ReturnType<
|
||||
typeof useGetSubscriptionStatusQuery
|
||||
>;
|
||||
export type GetSubscriptionStatusLazyQueryHookResult = ReturnType<
|
||||
typeof useGetSubscriptionStatusLazyQuery
|
||||
>;
|
||||
export type GetSubscriptionStatusSuspenseQueryHookResult = ReturnType<
|
||||
typeof useGetSubscriptionStatusSuspenseQuery
|
||||
>;
|
||||
export type GetSubscriptionStatusQueryResult = Apollo.QueryResult<
|
||||
GetSubscriptionStatusQuery,
|
||||
GetSubscriptionStatusQueryVariables
|
||||
>;
|
||||
export const CancelSubscriptionDocument = gql`
|
||||
mutation CancelSubscription {
|
||||
cancelSubscription {
|
||||
hasActiveSubscription
|
||||
subscriptionStatus
|
||||
currentPeriodStart
|
||||
currentPeriodEnd
|
||||
validUntil
|
||||
stripePriceId
|
||||
stripeSubscriptionId
|
||||
}
|
||||
}
|
||||
`;
|
||||
export type CancelSubscriptionMutationFn = Apollo.MutationFunction<
|
||||
CancelSubscriptionMutation,
|
||||
CancelSubscriptionMutationVariables
|
||||
>;
|
||||
|
||||
/**
|
||||
* __useCancelSubscriptionMutation__
|
||||
*
|
||||
* To run a mutation, you first call `useCancelSubscriptionMutation` within a React component and pass it any options that fit your needs.
|
||||
* When your component renders, `useCancelSubscriptionMutation` 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 [cancelSubscriptionMutation, { data, loading, error }] = useCancelSubscriptionMutation({
|
||||
* variables: {
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useCancelSubscriptionMutation(
|
||||
baseOptions?: Apollo.MutationHookOptions<
|
||||
CancelSubscriptionMutation,
|
||||
CancelSubscriptionMutationVariables
|
||||
>,
|
||||
) {
|
||||
const options = { ...defaultOptions, ...baseOptions };
|
||||
return Apollo.useMutation<
|
||||
CancelSubscriptionMutation,
|
||||
CancelSubscriptionMutationVariables
|
||||
>(CancelSubscriptionDocument, options);
|
||||
}
|
||||
export type CancelSubscriptionMutationHookResult = ReturnType<
|
||||
typeof useCancelSubscriptionMutation
|
||||
>;
|
||||
export type CancelSubscriptionMutationResult =
|
||||
Apollo.MutationResult<CancelSubscriptionMutation>;
|
||||
export type CancelSubscriptionMutationOptions = Apollo.BaseMutationOptions<
|
||||
CancelSubscriptionMutation,
|
||||
CancelSubscriptionMutationVariables
|
||||
>;
|
||||
export const ReactToVideoDocument = gql`
|
||||
mutation ReactToVideo($videoId: Int!, $reaction: ReactionEnum) {
|
||||
reactToVideo(videoId: $videoId, reaction: $reaction)
|
||||
|
@ -39,3 +39,27 @@ query GetAvailableSubscriptionOptions {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query GetSubscriptionStatus {
|
||||
getUserSubscriptionStatus {
|
||||
hasActiveSubscription
|
||||
subscriptionStatus
|
||||
currentPeriodStart
|
||||
currentPeriodEnd
|
||||
validUntil
|
||||
stripePriceId
|
||||
stripeSubscriptionId
|
||||
}
|
||||
}
|
||||
|
||||
mutation CancelSubscription {
|
||||
cancelSubscription {
|
||||
hasActiveSubscription
|
||||
subscriptionStatus
|
||||
currentPeriodStart
|
||||
currentPeriodEnd
|
||||
validUntil
|
||||
stripePriceId
|
||||
stripeSubscriptionId
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user