I am trying to use values inside shopify discount function but seems it is not working.
This is my graphql
query RunInput($selectedCollectionIds: [ID!], $tags: [String!]) {
discountNode {
metafield(namespace: "some-product-discounts", key: "function-configuration") {
value
}
}
cart {
lines {
quantity
merchandise {
...on ProductVariant {
id
product {
inAnyCollection(ids: $selectedCollectionIds)
hasAnyTag(tags: $tags)
id
}
}
}
promotionId: attribute (key: "_FOKKIO_shop_surprise_promotion_id") {
value
},
cost {
amountPerQuantity {
amount
currencyCode
}
totalAmount {
amount
currencyCode
}
}
}
}
presentmentCurrencyRate
}
I have the next result
{
"discountNode": {
"metafield": {
"value": "{\"selectedCollectionIds\":[\"gid://shopify/Collection/471875060002\"],\"tags\":[\"hero\"]}"
}
},
"cart": {
"lines": [
{
"quantity": 1,
"merchandise": {
"id": "gid://shopify/ProductVariant/43712112689442",
"product": {
"inAnyCollection": false,
"hasAnyTag": false,
"id": "gid://shopify/Product/7984435101986"
}
},
"promotionId": null,
"cost": {
"amountPerQuantity": {
"amount": "69.99",
"currencyCode": "USD"
},
"totalAmount": {
"amount": "69.99",
"currencyCode": "USD"
}
}
}
]
},
"presentmentCurrencyRate": "1.0"
}
"inAnyCollection": false,
"hasAnyTag": false,
but they are suposed to be true. Both of them.
When I don’t use input variables and just pass the values
inAnyCollection(ids: ["gid://shopify/Collection/471875060002"])
hasAnyTag(tags: ["hero"])
the are true.
What am I douing wrong?