I have a Shopify Function using Discounts API which will apply discounts depending on the product tags, e.g. if a product has a not-eligible-for-discount tag my FunctionResult will not apply discount to this.
My input.graphql is as follows
query Input {
cart {
lines {
quantity
merchandise {
__typename
...on ProductVariant {
id
product {
id
}
}
}
}
}
...
}
On my Function I was planning to get product.id (defined in my input.graphql) and then perform a graphql request to get the product tags given I can’t grab these from the Input query. The problem is that as the doc says it’s not possible to perform network requests or async operations. Is there any other approach I could follow to accomplish this? I can’t use hasAnyTag or hasTags to accomplish this because in this case I would have to provide the tags in the input.graphql file and instead I need to make the user able to provide the tags they want in a text field.