A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
How do I query for the discount code and discount value (e.g. 10%, 20%, $5) discounted from each lineItem in orders?
With the following query I am able to get the actual final amount discounted on a line, but not the discount value - and I get the discount code applied to the entire order, but I need to know by lineItem (in case there is some mixing and matching of discounts).
query orders_discounts($id:String){
orders(first:1, query:$id ){
nodes{
discountCodes
lineItems(first:20){
nodes{
quantity
originalUnitPrice
discountAllocations{
allocatedAmount{
amount
}
}
}
}
}
}
}
Would this data be stored within discountAllocation.discountApplication? If so, how does one query it?
Thanks in advance!