import {
  CONTACT_INFO,
  MOBILE_PURCHASE_INFO,
  PAYMENT_REQUIREMENTS,
  SHIPPING_INFO,
} from 'graphql/fragments/cart';
import gql from 'graphql-tag';

export const MOBILE_CART_QUERY = gql`
  query mobileCart($input: CartInput) {
    cart(input: $input) {
      id
      totalMonthlyCharge
      totalSubscriptionFee
      totalRentalFee
      totalDue
      requiresContactInfo
      isValid
      items {
        id
        variantId
        quantity
        price
        title
        monthlyCharge
        subscriptionFee
        purchaseInfo {
          ...MobilePurchaseInfoFragment
        }
        validationErrors {
          message
          code
        }
      }
      contact {
        ...ContactFragment
      }
      shippingInfo {
        ...ShippingInfoFragment
      }
      paymentInputRequired
      paymentRequirements {
        ...PaymentRequirementsFragment
      }
    }
  }
  ${MOBILE_PURCHASE_INFO}
  ${PAYMENT_REQUIREMENTS}
  ${CONTACT_INFO}
  ${SHIPPING_INFO}
`;
