import { gql } from '@apollo/client';

export const CART_SHIPPING = gql`
  query CartShipping(
    $input: CartInput
    $availableShippingMethodsInput: AvailableShippingMethodsInput
  ) {
    cart(input: $input) {
      id
      availableShippingMethods(input: $availableShippingMethodsInput) {
        shippingType
        price
        available
        options {
          key
          value
          title
          description
          address
          postcode
          city
        }
        shippingInstructions {
          id
          title
          description
          includedInService
          serviceType
          quantity
        }
        requires
        title
      }
      contact {
        address
        zip
      }
      shippingInfo {
        id
        shippingType
        shippingDetails {
          address
          zip
          storename
          postbox
          dropp
          freeProductSetup
          productSetup
          rentalBundleSetup
          extraInfo
          shippingInstructions {
            count
            type
            message
          }
        }
      }
    }
  }
`;

export const CART_AVAILABLE_SHIPPING_METHODS = gql`
  query CartAvailableShippingMethods(
    $input: CartInput
    $availableShippingMethodsInput: AvailableShippingMethodsInput
  ) {
    cart(input: $input) {
      id
      shippingInfo {
        id
      }
      availableShippingMethods(input: $availableShippingMethodsInput) {
        shippingType
        options {
          key
          value
          title
          description
        }
      }
    }
  }
`;
