Check if DeliveryProfile applies to all products or some products

nepthar2
Tourist
4 0 2

Hello!

We're using the GQL api to examine ShippingZones and DeliveryProfiles to answer the question: "does this shop provide free shipping on all products?" Our first attempt was to see how many variants were in the deliveryProfile and compare that to the total number of products, thinking that if those were equal, then the profile applied to everything.

So far, we've found out that we can find the number of variants which are associated with a DeliveryProfile by a query like this:

{
  deliveryProfile(id: "gid://shopify/DeliveryProfile/XXXXXXX") {
    id
    name
    default
    productVariantsCountV2 {
      count
      capped
    }
  }
}

 

For a large shop, that will, of course, report `{ count: 500, capped: true }`, making my strategy useless. Is there another way to figure out whether the profile applies to everything or just certain products?

Reply 1 (1)

nepthar2
Tourist
4 0 2

Friendly nudge. Maybe one of the Shopify folks could chime in here and provide some guidance?