Out now! Check out the Poll results: Do you have a Shopify store?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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 25

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