Hi, I’m building a discount function where I want to apply the discount if the product is part of a specific collection. Is there a way to dynamically put collections in the function input instead of hardcoding the collection ids? The official docs only shows an example of the hardcoded way from what I understand.
Reference: Use variables in input queries
And I also cannot test the RunInput in the Shopify GraphiQL App because “Shopify GraphQL App or Explorer only available for admin or storefront API,
but now you use the Shopify Function input which is not valid”.
Reference: Solved: Re: Error getting graphql RunInput in graphQL preview - Shopify Community
Here is my run.graphq
query RunInput {
cart {
lines {
id
quantity
merchandise {
__typename
... on ProductVariant {
id
product {
id
title
inCollections(ids: [
"gid://shopify/Collection/29638****097",
"gid://shopify/Collection/29638****777"
]) {
collectionId
isMember
}
}
}
}
}
}
discountNode {
.. rest of the run.graphql