Storefront API Search product title with language

Hi,

The storefront api works great to retrieve the information in a specific language. But what about querying the translated fields, is that possible?

Currently I can search a product by part of the title doing something like:

Storefront.client.product.fetchQuery({first:10,query:"title:*gold*"}).then(product=>(product))

This returns all products with the word “gold” in the title. I can even get the results in the language I want. But the field being queries (title) is always the default language one.

For instance if the user is portuguese and searches for “ouro” (“gold” in portuguese) the API should search for items with the word “ouro” in the portuguese title, not the english (default) title field.

Is this possible?

Hi,

We are facing the same issue. Did you end up finding a solution for this?

did you find the solution ?

Hi ,

I use the same soultion u provide to search a product by part of the title.

I write this

query SearchProductsByTitle($title: String!) {
products(query:“title:$title”, first: 10) {}
}
and I pass the titel like this

await getData({
variables: {
title:value
}
});
but it return this error :“Variable $title is declared by SearchProductsByTitle but not used”
can anyone help me with that pleaseee