Skip to content

Instantly share code, notes, and snippets.

@cipriancaba
Created May 24, 2020 13:56
Show Gist options
  • Save cipriancaba/1f543a10f3c53024746e70e51ba875d8 to your computer and use it in GitHub Desktop.
Save cipriancaba/1f543a10f3c53024746e70e51ba875d8 to your computer and use it in GitHub Desktop.
export const ListUserSubscriptionsByUserDocument = gql`
query ListUserSubscriptionsByUser($userId: ID, $subscriptionId: ModelIDKeyConditionInput, $sortDirection: ModelSortDirection, $filter: ModelUserSubscriptionFilterInput, $limit: Int, $nextToken: String) {
listUserSubscriptionsByUser(userId: $userId, subscriptionId: $subscriptionId, sortDirection: $sortDirection, filter: $filter, limit: $limit, nextToken: $nextToken) {
items {
id
platform
userId
subscriptionId
receipt
nextPaymentDate
status
cancellationReason
createdAt
updatedAt
userSubscriptionPayments {
items {
id
platform
userSubscriptionId
receipt
nextPaymentDate
couponId
status
createdAt
}
nextToken
}
}
nextToken
}
}
`;
export function useListUserSubscriptionsByUserQuery(options: Omit<Urql.UseQueryArgs<ListUserSubscriptionsByUserQueryVariables>, 'query'> = {}) {
return Urql.useQuery<ListUserSubscriptionsByUserQuery>({ query: ListUserSubscriptionsByUserDocument, ...options });
export type ListUserSubscriptionsByUserQuery = (
{ __typename?: 'Query' }
& { listUserSubscriptionsByUser?: Maybe<(
{ __typename?: 'ModelUserSubscriptionConnection' }
& Pick<ModelUserSubscriptionConnection, 'nextToken'>
& { items?: Maybe<Array<Maybe<(
{ __typename?: 'UserSubscription' }
& Pick<UserSubscription, 'id' | 'platform' | 'userId' | 'subscriptionId' | 'receipt' | 'nextPaymentDate' | 'status' | 'cancellationReason' | 'createdAt' | 'updatedAt'>
& { userSubscriptionPayments?: Maybe<(
{ __typename?: 'ModelUserSubscriptionPaymentConnection' }
& Pick<ModelUserSubscriptionPaymentConnection, 'nextToken'>
& { items?: Maybe<Array<Maybe<(
{ __typename?: 'UserSubscriptionPayment' }
& Pick<UserSubscriptionPayment, 'id' | 'platform' | 'userSubscriptionId' | 'receipt' | 'nextPaymentDate' | 'couponId' | 'status' | 'createdAt'>
)>>> }
)> }
)>>> }
)> }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment