Hi there,
We use discountNodes
as below to retrieve all discounts with a specific prefix and then update each of the discounts where Shipping Discount is not enabled.
The problem with this is that it’s inefficient, if you have a lot of discounts and only 3 need updating.
I know you can use combines_with:shipping_discounts
to get all discounts where that is enabled but I am looking for all discounts where it is not.
Note: I am using a webhook to update each discount as they are created (Google Shopping Feed does not support combinations) but we also need a fallback just in case to update all of the discounts that haven’t been processed by the webhook.
Does anyone know of a way to get all discounts with a code that contains a string and that either has no combines_with
set, or at least combines_with:shipping_discounts
not set?
query discounts($cursor: String) {
discountNodes(query: "prefix-", first: 250, after: $cursor) {
nodes {
id
discount {
... on DiscountCodeBasic {
title
}
... on DiscountCodeBxgy {
title
}
... on DiscountCodeFreeShipping {
title
}
... on DiscountAutomaticApp {
title
}
... on DiscountAutomaticBasic {
title
}
... on DiscountAutomaticBxgy {
title
}
... on DiscountAutomaticFreeShipping {
title
}
}
}
pageInfo {
endCursor
hasNextPage
}
}
}