Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 9965ed7

Browse files
authored
Merge pull request #3803 from magento/em_magento-graphqlStoreConfig
Adding GraphQL CMS and Theme Attributes to storeConfig
2 parents 30e4adf + fa37246 commit 9965ed7

File tree

1 file changed

+122
-14
lines changed

1 file changed

+122
-14
lines changed

guides/v2.3/graphql/reference/store-config.md

Lines changed: 122 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,80 @@
11
---
22
group: graphql
3-
title: storeConfig endpoint
3+
title: Store endpoint
44
---
55

6-
The `storeConfig` endpoint returns information about a store's configuration, including its locale, currency codes, and the secure and unsecure URLs.
6+
The `Store` endpoint defines information about a store's configuration. You can query a non-default store by [changing the header]({{ page.baseurl }}/graphql/send-request.html) in your GraphQL request.
77

88
## Query structure
99

1010
`storeConfig: StoreConfig`
1111

12-
## Supported attributes
12+
### Supported storeConfig attributes
13+
14+
Use the `storeConfig` attributes to retrieve information about the store's configuration; such as, locale, currency codes, and secure and unsecure URLs.
1315

1416
Attribute | Data Type | Description
1517
--- | --- | ---
16-
`id` | Integer | The ID number assigned to the store
17-
`code` | String | A unique identifier for the store
18-
`website_id` | Integer | The ID number assigned to the parent website
19-
`locale` | String | The store's locale, such as `en_US`
2018
`base_currency_code` | String | The code representing the currency in which Magento processes all payment transactions, such as `USD`
21-
`default_display_currency_code` | String | The code representing the currency displayed on the store, such as `USD`
22-
`timezone` | String | The store's time zone, such as `America/Chicago`
23-
`weight_unit` | String | The weight unit for products, such as `lbs` or `kgs`
24-
`base_url` | String | The store's fully-qualified base URL, such as `http://magentohost.example.com/`
2519
`base_link_url` | String | A fully-qualified URL that is used to create relative links to the `base_url`
2620
`base_static_url` | String | The fully-qualified URL that specifies the location of static view files, such as `http://magentohost.example.com/pub/static/`
2721
`base_media_url` | String | The fully-qualified URL that specifies the location of user media files, such as `http://magentohost.example.com/pub/media/`
28-
`secure_base_url` | String | The store's fully-qualified secure base URL, such as `https://magentohost.example.com/`
29-
`secure_base_link_url` | String | A fully-qualified URL that is used to create relative links to the `base_url`
30-
`secure_base_static_url` | String | The secure fully-qualified URL that specifies the location of static view files, such as `https://magentohost.example.com/pub/static/`
22+
`base_url` | String | The store's fully-qualified base URL, such as `http://magentohost.example.com/`
23+
`code` | String | A unique identifier for the store
24+
`default_display_currency_code` | String | The code representing the currency displayed on the store, such as `USD`
25+
`id` | Integer | The ID number assigned to the store
26+
`locale` | String | The store's locale, such as `en_US`
27+
`secure_base_link_url` | String | A secure fully-qualified URL that is used to create relative links to the `base_url`
3128
`secure_base_media_url` | String | The secure fully-qualified URL that specifies the location of user media files, such as `https://magentohost.example.com/pub/media/`
29+
`secure_base_static_url` | String | The secure fully-qualified URL that specifies the location of static view files, such as `https://magentohost.example.com/pub/static/`
30+
`secure_base_url` | String | The store's fully-qualified secure base URL, such as `https://magentohost.example.com/`
31+
`timezone` | String | The store's time zone, such as `America/Chicago`
32+
`website_id` | Integer | The ID number assigned to the parent website
33+
`weight_unit` | String | The weight unit for products, such as `lbs` or `kgs`
34+
{:style="table-layout:auto;"}
35+
36+
### Supported theme attributes
37+
38+
Use the `theme` attributes to retrieve information about the store's thematic elements; such as, footer and header information, copyright text, and logo information. These attributes are defined in the `ThemeGraphQl` module.
39+
40+
Attribute | Data Type | Description
41+
--- | --- | ---
42+
`absolute_footer` | String | Contains scripts that must be included in the HTML before the closing `<body>` tag
43+
`copyright` | String | The copyright statement that appears at the bottom of each page
44+
`default_description` | String | The description that provides a summary of your site for search engine listings and should not be more than 160 characters in length
45+
`default_keywords` | String | A series of keywords that describe your store, each separated by a comma
46+
`default_title` | String | The title that appears at the title bar of each page when viewed in a browser
47+
`demonotice` | Int | Controls the display of the demo store notice at the top of the page. Options: `0` (No) or `1` (Yes)
48+
`head_includes` | String | Contains scripts that must be included in the HTML before the closing `<head>` tag
49+
`header_logo_src` | String | The path to the logo that appears in the header
50+
`head_shortcut_icon` | String | Uploads the small graphic image that appears in the address bar and tab of the browser
51+
`logo_alt` | String | The Alt text that is associated with the logo
52+
`logo_height` | Int | The height of your logo image in pixels
53+
`logo_width` | Int | The width of your logo image in pixels
54+
`title_prefix` | String | A prefix that appears before the title to create a two- or three-part title
55+
`title_suffix` | String | A suffix that appears after the title to create a two-or three part title
56+
`welcome` | String | Text that appears in the header of the page and includes the name of customers who are logged in
3257
{:style="table-layout:auto;"}
3358

59+
### Supported CMS attributes
60+
61+
Use the `cms` attributes to retrieve information about the store's default pages. These attributes are defined in the `CmsGraphQl` module.
62+
63+
Attribute | Data Type | Description
64+
--- | --- | ---
65+
`cms_home_page` | String | Returns the name of the CMS page that identifies the home page for the store
66+
`cms_no_cookies` | String | Identifies a specific CMS page that appears when cookies are not enabled for the browser
67+
`cms_no_route` | String | Identifies a specific CMS page that you want to appear when a 404 “Page Not Found” error occurs
68+
`front` | String | Indicates the landing page that is associated with the base URL
69+
`no_route` | String | Contains the URL of the default page that you want to appear when if a 404 “Page not Found” error occurs
70+
`show_cms_breadcrumbs` | Int | Determines if a breadcrumb trail appears on all CMS pages in the catalog. Options: `0` (No) or `1` (Yes)
71+
{:style="table-layout:auto;"}
72+
73+
3474
## Example usage
3575

76+
### Query a store's configuation
77+
3678
The following call returns all details of a store's configuration.
3779

3880
**Request**
@@ -86,3 +128,69 @@ The following call returns all details of a store's configuration.
86128
}
87129
}
88130
```
131+
132+
### Query a store's theme
133+
134+
The following query returns information about the store's default title, keywords, and welcome text.
135+
136+
**Request**
137+
138+
``` text
139+
{
140+
storeConfig {
141+
default_title,
142+
default_keywords,
143+
welcome
144+
}
145+
}
146+
```
147+
148+
**Response**
149+
150+
``` json
151+
{
152+
"data": {
153+
"storeConfig": {
154+
"default_title": "Magento Enterprise Edition",
155+
"default_keywords": "Magento, Varien, E-commerce",
156+
"welcome": "Default welcome msg!"
157+
}
158+
}
159+
}
160+
```
161+
162+
### Query a store's CMS configuration
163+
164+
The following query returns information about the store's content pages.
165+
166+
**Request**
167+
168+
``` text
169+
{
170+
storeConfig {
171+
front,
172+
cms_home_page,
173+
no_route,
174+
cms_no_route,
175+
cms_no_cookies,
176+
show_cms_breadcrumbs
177+
}
178+
}
179+
```
180+
181+
**Response**
182+
183+
``` json
184+
{
185+
"data": {
186+
"storeConfig": {
187+
"front": "cms",
188+
"cms_home_page": "home",
189+
"no_route": "cms/noroute/index",
190+
"cms_no_route": "no-route",
191+
"cms_no_cookies": "enable-cookies",
192+
"show_cms_breadcrumbs": 1
193+
}
194+
}
195+
}
196+
```

0 commit comments

Comments
 (0)