cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch custom product attributes value using Graphql API?

How to fetch custom product attributes value using Graphql API?

Hi,
I'm trying to add custom data for the products by using the concept of creating custom product attributes. I've created the custom product attribute with the code "product_title_hindi" and now I'm looking for the solution so that I can fetch the value of "product_title_hindi" in my products query.
Can anyone please let me know that how can I fetch the custom attributes data using Graphql?

P.S: I'm looking for the complete API based solution.

 

I'm trying the below query but that's not a correct way as it's throwing an error "message": "Cannot query field \"product_title_hindi\" on type \"ProductInterface\".",

{
  products(search: "", pageSize: 10) {
    total_count
    items {
      name
      product_title_hindi
      uid
      sku
      url_key
    }
    page_info {
      page_size
      current_page
    }
  }
}

Any help is much appreciated!
Thanks