GraphQL query priceLists is not getting particular country

GraphQL query priceLists is not getting particular country

maniaroxo
Shopify Partner
2 0 0

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
}
}
}
}
}
}

Reply 1 (1)

Alan
Shopify Staff
129 15 24

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