I am creating a custom storefront using Shopify's BUY SDK.
import Client from 'shopify-buy'
const client = Client.buildClient({
domain: 'xxxxxxxxxxx.myshopify.com',
storefrontAccessToken: 'xxxxxxxxxxxxxxxxxe6347d45b08'
})
I have no problem fetching all products:
client.product.fetchAll().then((products) => {
// Do something with the products
console.log(products)
})
I also have no problem filtering by tag:
let query = {
query: "tag:[aeropress,espresso]"
}
client.product.fetchQuery(query).then((products) => {
console.log(products)
})
and no problem fetching by product_type:
let query = {
query: "product_type: Coffe Beans"
}
client.product.fetchQuery(query).then((products) => {
console.log(products)
})
where I am running into a problem is filtering with multiple queries (in this case, tag and product_type). I have tried a couple of different ways to structure the query to no avail:
let query = {
query: "product_type: Coffe Beans, tag: [aeropress, espresso]"
}
let query = {
query: "{product_type: Coffe Beans, tag: [aeropress, espresso]}"
}
I'm sure there's something simple that I am missing (or maybe its not possible to query with multiple filters?). Has anybody else had success using the Shopify Buy SDK with multiple filters?
For reference, I am following these docs:
https://shopify.github.io/js-buy-sdk/
https://help.shopify.com/api/storefront-api/reference/object/shop#products
https://github.com/Shopify/js-buy-sdk/blob/master/tutorials/MIGRATION_GUIDE.md