How to display products with applied discount codes in React JS and GraphQL?

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…