how to sync and get adobe custom_attributes in api productSearch of Live Search

146 Views Asked by At

how can i get custom value(brand) from adobe via graphql https://commerce.adobe.io/search/graphql here is my query

query productSearch {
  productSearch(phrase: "bag") {
    total_count
    items {
      product {
        name
        sku
        custom_attributes {
          code
          value
        }
      }
    }
    facets {
      title
    }
  }
}

headers { "Magento-Environment-Id": "xxxxxxxxxxxxxxxxxxx", "Magento-Website-Code": "base", "Magento-Store-Code": "main_website_store", "Magento-Store-View-Code": "default", "X-Api-Key": "search_gql" } enter image description here

1

There are 1 best solutions below

0
On

Make sure brand is added to the search index and then you can request through graphQL request. Something like this.

query productSearch {
 productSearch(phrase: "bag") {
  total_count
  items {
   product {
    name
    sku
    brand
    custom_attributes {
      code
      value
    }
   }
  }
  facets {
   title
  }
 }
}