Skip to content

Commit 2eb989e

Browse files
DEVDOCS-6453 - add resourceId to translation gql docs (#1035)
<!-- Ticket number or summary of work --> # [DEVDOCS-6453] ## What changed? <!-- Provide a bulleted list in the present tense --> * Documentation for filtering translations by resourceId for brands, categories, and locations resource types. ## Release notes draft Updated documentation for filtering translations by resourceId ping @bc-janet [DEVDOCS-6453]: https://bigcommercecloud.atlassian.net/browse/DEVDOCS-6453?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 61b59f9 commit 2eb989e

File tree

4 files changed

+541
-146
lines changed

4 files changed

+541
-146
lines changed

docs/store-operations/translations/brands.mdx

Lines changed: 202 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
# Translations for Brands (Beta)
22

3-
<Callout type="info">
4-
The Translations Admin GraphQL API is currently available on Catalyst storefronts only.
3+
<Callout type='info'>
4+
The Translations Admin GraphQL API is currently available on Catalyst
5+
storefronts only.
56
</Callout>
67

78
The brands translatable fields are:
89

9-
* Name
10-
* Page Title
11-
* Meta Keywords
12-
* Meta Description
13-
* Search Keywords
10+
- Name
11+
- Page Title
12+
- Meta Keywords
13+
- Meta Description
14+
- Search Keywords
1415

1516
## Examples
1617

1718
Below are examples of GraphQL queries and mutations for retrieving and managing translation settings for brands.
1819

1920
### Query translations
2021

21-
This query returns a paginated list of translations by resourceType, channel and locale with a maximum of 50 results per request.
22+
#### Query a list of translations
23+
24+
This query returns a paginated list of translations by resourceType, channel and locale with a maximum of 50 results per request.
2225

2326
<Tabs items={['Request', 'Response']}>
2427
<Tab>
2528

26-
```graphql filename="Example mutation: Query a translation" showLineNumbers copy
29+
```graphql filename="Example query: Query a list of translations" showLineNumbers copy
2730
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
2831
X-Auth-Token: {{token}}
2932

@@ -53,54 +56,189 @@ query {
5356
</Tab>
5457
<Tab>
5558

56-
```json filename="Example query: Query a translation" showLineNumbers copy
59+
```json filename="Example query: Query a list of translations" showLineNumbers copy
5760
{
58-
"data": {
59-
"store": {
60-
"translations": {
61-
"edges": [
62-
{
63-
"node": {
64-
"resourceId": "bc/store/brand/24",
65-
"fields": [
66-
{
67-
"fieldName": "name",
68-
"original": "my channel level brands",
69-
"translation": "name (OVR) 1"
70-
},
71-
{
72-
"fieldName": "description",
73-
"original": "<p>my channel level brands description</p>",
74-
"translation": "description (OVR)"
75-
},
76-
{
77-
"fieldName": "page_title",
78-
"original": "Second Home page title",
79-
"translation": "page_title (OVR)"
80-
},
81-
{
82-
"fieldName": "meta_description",
83-
"original": "Second Meta description",
84-
"translation": "meta_description (OVR)"
85-
},
86-
{
87-
"fieldName": "meta_keywords",
88-
"original": "Second Meta Keywords",
89-
"translation": "meta keywords (OVR)"
90-
},
91-
{
92-
"fieldName": "search_keywords",
93-
"original": "Second Search keywords",
94-
"translation": "search_keywords (OVR)"
95-
}
96-
]
97-
},
98-
"cursor": "eyJpZCI6MjR9"
99-
}
100-
]
101-
}
61+
"data": {
62+
"store": {
63+
"translations": {
64+
"edges": [
65+
{
66+
"node": {
67+
"resourceId": "bc/store/brand/24",
68+
"fields": [
69+
{
70+
"fieldName": "name",
71+
"original": "my channel level brands",
72+
"translation": "name (OVR) 1"
73+
},
74+
{
75+
"fieldName": "description",
76+
"original": "<p>my channel level brands description</p>",
77+
"translation": "description (OVR)"
78+
},
79+
{
80+
"fieldName": "page_title",
81+
"original": "Second Home page title",
82+
"translation": "page_title (OVR)"
83+
},
84+
{
85+
"fieldName": "meta_description",
86+
"original": "Second Meta description",
87+
"translation": "meta_description (OVR)"
88+
},
89+
{
90+
"fieldName": "meta_keywords",
91+
"original": "Second Meta Keywords",
92+
"translation": "meta keywords (OVR)"
93+
},
94+
{
95+
"fieldName": "search_keywords",
96+
"original": "Second Search keywords",
97+
"translation": "search_keywords (OVR)"
98+
}
99+
]
100+
},
101+
"cursor": "eyJpZCI6MjR9"
102+
}
103+
]
104+
}
105+
}
106+
}
107+
}
108+
```
109+
110+
</Tab>
111+
</Tabs>
112+
113+
#### Query a translation by resourceId
114+
115+
<Callout type='warning'>
116+
When querying a translation by resourceId, you must provide the full
117+
resourceId in the format `bc/store/brand/{brand_id}`.
118+
</Callout>
119+
120+
This query returns a translation by resourceId.
121+
122+
<Tabs items={['Request', 'Response']}>
123+
<Tab>
124+
125+
```graphql filename="Example query: Query a translation by resource id" showLineNumbers copy
126+
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
127+
X-Auth-Token: {{token}}
128+
129+
query {
130+
store {
131+
translations(filters: {
132+
resourceType: BRANDS,
133+
channelId: "bc/store/channel/2",
134+
localeId: "bc/store/locale/it",
135+
resourceIds: ["bc/store/brand/1", "bc/store/brand/2"]
136+
}) {
137+
edges {
138+
node {
139+
resourceId
140+
fields {
141+
fieldName
142+
original
143+
translation
144+
}
145+
}
146+
cursor
147+
}
148+
}
102149
}
103-
}
150+
}
151+
```
152+
153+
</Tab>
154+
<Tab>
155+
156+
```json filename="Example query: Query a translation by resource id" showLineNumbers copy
157+
{
158+
"data": {
159+
"store": {
160+
"translations": {
161+
"edges": [
162+
{
163+
"node": {
164+
"resourceId": "bc/store/brand/1",
165+
"fields": [
166+
{
167+
"fieldName": "name",
168+
"original": "my channel level brands",
169+
"translation": "name (OVR) 1"
170+
},
171+
{
172+
"fieldName": "description",
173+
"original": "<p>my channel level brands description</p>",
174+
"translation": "description (OVR)"
175+
},
176+
{
177+
"fieldName": "page_title",
178+
"original": "Second Home page title",
179+
"translation": "page_title (OVR)"
180+
},
181+
{
182+
"fieldName": "meta_description",
183+
"original": "Second Meta description",
184+
"translation": "meta_description (OVR)"
185+
},
186+
{
187+
"fieldName": "meta_keywords",
188+
"original": "Second Meta Keywords",
189+
"translation": "meta keywords (OVR)"
190+
},
191+
{
192+
"fieldName": "search_keywords",
193+
"original": "Second Search keywords",
194+
"translation": "search_keywords (OVR)"
195+
}
196+
]
197+
},
198+
"cursor": "eyJpZCI6MjR9"
199+
},
200+
{
201+
"node": {
202+
"resourceId": "bc/store/brand/2",
203+
"fields": [
204+
{
205+
"fieldName": "name",
206+
"original": "my channel level brands",
207+
"translation": "name (OVR) 1"
208+
},
209+
{
210+
"fieldName": "description",
211+
"original": "<p>my channel level brands description</p>",
212+
"translation": "description (OVR)"
213+
},
214+
{
215+
"fieldName": "page_title",
216+
"original": "Second Home page title",
217+
"translation": "page_title (OVR)"
218+
},
219+
{
220+
"fieldName": "meta_description",
221+
"original": "Second Meta description",
222+
"translation": "meta_description (OVR)"
223+
},
224+
{
225+
"fieldName": "meta_keywords",
226+
"original": "Second Meta Keywords",
227+
"translation": "meta keywords (OVR)"
228+
},
229+
{
230+
"fieldName": "search_keywords",
231+
"original": "Second Search keywords",
232+
"translation": "search_keywords (OVR)"
233+
}
234+
]
235+
},
236+
"cursor": "eyJpZCI6MjJ7"
237+
}
238+
]
239+
}
240+
}
241+
}
104242
}
105243
```
106244

@@ -177,7 +315,7 @@ mutation {
177315
}
178316
}
179317
}
180-
```
318+
````
181319

182320
</Tab>
183321
</Tabs>
@@ -223,14 +361,14 @@ mutation {
223361

224362
```json filename="Example mutation: Delete a translation" showLineNumbers copy
225363
{
226-
"data": {
227-
"translation": {
228-
"deleteTranslations": {
229-
"__typename": "DeleteTranslationsResult",
230-
"errors": []
231-
}
232-
}
233-
}
364+
"data": {
365+
"translation": {
366+
"deleteTranslations": {
367+
"__typename": "DeleteTranslationsResult",
368+
"errors": []
369+
}
370+
}
371+
}
234372
}
235373
```
236374

0 commit comments

Comments
 (0)