In this tutorial, We will explain how to get the store’s catalog configuration value using GraphQL in Magento 2. To fetch the data you need to set the endpoint.
Here, explained all configuration data using storeConfig query. First of all, we will show you how to get details of the store’s catalog configuration.
Query a store’s Catalog configuration
The following query returns all details of the store’s cms configuration:
Request:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
{ storeConfig { product_url_suffix category_url_suffix title_separator list_mode grid_per_page_values list_per_page_values grid_per_page list_per_page catalog_default_sort_by } } |
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
{ "data": { "storeConfig": { "product_url_suffix": ".html", "category_url_suffix": ".html", "title_separator": "-", "list_mode": "grid-list", "grid_per_page_values": "12,24,36", "list_per_page_values": "5,10,15,20,25", "grid_per_page": 12, "list_per_page": 10, "catalog_default_sort_by": "position" } } } |
We hope this post helps you to get the values of catalog configurations.
Thank You!
Hit 5 Stars if you find this post helpful
0 (based on 0 Reviews)