Hello, im trying to use shopify api with several markets. For display localized currencyCode`s and prices i use inContext directive with country parameter. For primary US market filtration works correctly, but when i send query with another market my filtration stops working and return me results without filtration
Also how to get filters field with price, if i add inContext directive price filter is not returning
Query example:
query Products(
$reverse: Boolean
$sortKey: ProductCollectionSortKeys
$filters: [ProductFilter!]
$countryCode: CountryCode
) @inContext(country: $countryCode) {
collection(handle: "all-products") {
products(first: 10, reverse: $reverse, sortKey: $sortKey, filters: $filters) {
nodes {
variants(first: 1) {
nodes {
...ShopifySetData
}
}
}
}
}
}
fragment ShopifySetData on ProductVariant {
sku
price {
...ShopifyMoneyV2
}
}
fragment ShopifyMoneyV2 on MoneyV2 {
amountV2: amount
currencyCode
}
Parameters example:
{
"countryCode": "UA",
"filters": {
"price": {
"min": 0,
"max": 500
}
}
}
Result
{
"data": {
"collection": {
"products": {
"nodes": [
{
"variants": {
"nodes": [
{
"sku": "20101",
"price": {
"amountV2": "113643.0",
"currencyCode": "UAH"
}
}
]
}
},
{
"variants": {
"nodes": [
{
"sku": "20104",
"price": {
"amountV2": "7835.0",
"currencyCode": "UAH"
}
}
]
}
}
]
}
}
},
"extensions": {
"context": {
"country": "UA",
"language": "EN"
}
}
}