fragment TaxBaseLine on TaxableObjectLine {
  sourceLine {
    __typename
    ... on CheckoutLine {
      id
      productVariant: variant {
        id
        product {
          metafield(key: "taxjar_tax_code")
          productType {
            metafield(key: "taxjar_tax_code")
          }
        }
      }
    }
    ... on OrderLine {
      id
      variant {
        id
        product {
          metafield(key: "taxjar_tax_code")
          productType {
            metafield(key: "taxjar_tax_code")
          }
        }
      }
    }
  }
  quantity
  unitPrice {
    amount
  }
  totalPrice {
    amount
  }
}
fragment TaxDiscount on TaxableObjectDiscount {
  name
  amount {
    amount
  }
}

fragment TaxBase on TaxableObject {
  pricesEnteredWithTax
  currency
  channel {
    slug
  }
  discounts {
    ...TaxDiscount
  }
  address {
    ...Address
  }
  shippingPrice {
    amount
  }
  lines {
    ...TaxBaseLine
  }
  sourceObject {
    ... on Checkout {
      user {
        id
      }
    }
    ... on Order {
      user {
        id
      }
    }
  }
}
