Shopify / ui-extensions

MIT License
249 stars 35 forks source link

Unable to Access Product Tags in Shopify Discount Function GraphQL Query #2039

Open ksyp-7 opened 1 month ago

ksyp-7 commented 1 month ago

Describe the changes you are looking for

I'm trying to access product tags in my Shopify discount function query using GraphQL. Specifically, I need to retrieve all tags linked to my product. However, it seems that this is not currently possible with the existing schema. Below is my current query:

  cart {
    lines {
      quantity
      merchandise {
        ...on ProductVariant {
          id
          sku
          product {
            hasAnyTag(tags: ["demo"])
          }
        }
        __typename
      }
    }
  }
  discountNode {
    metafield(namespace: "volume-discount", key: "function-configuration") {
      value
    }
  }
}

Problem: I need to access all tags associated with the product, but the current schema only allows for checking if a product has any of the specified tags. This limitation hinders the functionality I am trying to implement.

Request: Could you please provide guidance on how to access all product tags in the GraphQL query? If this feature is not currently supported, I would like to request its addition to the schema.