A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Couldn't able to make GraphQL query with condition particular single country
{
priceLists(first: 1,matchRule: PriceListContext countries: US ) {
edges {
node {
id
name
currency
contextRule {
countries
}
parent {
adjustment {
type
value
}
}
prices(first: 1) {
edges {
cursor,
node {
variant {
id
}
price {
amount
currencyCode
}
compareAtPrice {
amount
currencyCode
}
originType
}
}
}
}
}
}
Hey @maniaroxo - thanks for reaching out. I may have an answer for this if you haven't already resolved this. Can you try the following query and let us know if this works?
{
priceLists(first: 1, matchRule: { country: US } ) {
edges {
node {
id
name
currency
contextRule {
countries
}
parent {
adjustment {
type
value
}
}
prices(first: 1) {
edges {
cursor,
node {
variant {
id
}
price {
amount
currencyCode
}
compareAtPrice {
amount
currencyCode
}
originType
}
}
}
}
}
}
When making the query on the PriceListContext param, you wouldn't need to include it textually in the query, just the contexts you want to search for (in this case the country).
Hope this helps and thanks very much for your patience on this - it's much appreciated.
Alan | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog