App reviews, troubleshooting, and recommendations
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
i want to show products with discount code coupon apply for this product automatically with code / react js /graphql
Hi @ocianX ,
Here is graphql to get products with discount code coupon.
query DISCOUNT {
shop {
name
}
codeDiscountNodes(first: 10) {
edges {
node {
id
codeDiscount {
... on DiscountCodeBasic {
codes(first: 2) {
edges {
node {
id
code
}
}
}
customerGets {
items {
... on DiscountProducts {
__typename
products(first: 10) {
edges {
node {
id
handle
title
}
}
}
}
}
value {
... on DiscountPercentage {
__typename
percentage
}
}
}
}
}
}
}
}
}
This will give you products with discount codes and value.
Let me know this worked for you or not.
Thanks....