A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi all,
I would like to ask how I can get the value and value_type of a price rule over GraphQL.
When I take a look at REST API, the value and value_type have been returned
https://shopify.dev/docs/admin-api/rest/reference/discounts/pricerule#show-2021-01
But when I try to look up these values in GraphQL I have no clue where I can get the values.
There is no equivalent value_type and the "valueV2" gives me nothing.
Do you have any idea where I can the values from?
Thank you.
Solved! Go to the solution
This is an accepted solution.
Try this.
{
priceRules(first: 5, reverse:true) {
edges {
node {
id
title
status
valueV2 {
__typename
... on PricingPercentageValue {
percentage
}
... on MoneyV2 {
amount
currencyCode
}
}
}
}
}
}
This is an accepted solution.
Try this.
{
priceRules(first: 5, reverse:true) {
edges {
node {
id
title
status
valueV2 {
__typename
... on PricingPercentageValue {
percentage
}
... on MoneyV2 {
amount
currencyCode
}
}
}
}
}
}