Skip to content

Commit c4132d7

Browse files
committed
graphql_queries.md: extend item example with conditional fields
1 parent 5b8220d commit c4132d7

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

docs/api/graphql/graphql_queries.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To get a specific content item by its content ID, location ID, or URL alias, use
1515
```
1616
{
1717
content {
18-
article (contentId: 62) {
18+
article(contentId: 62) {
1919
title
2020
author {
2121
name
@@ -52,8 +52,17 @@ The query accepts `locationId`, `remoteId`, and `urlAlias` as arguments.
5252

5353
```
5454
{
55-
item (locationId: 2) {
55+
item(locationId: 2) {
5656
_name
57+
... on FolderItem {
58+
name
59+
}
60+
... on LandingPageItem {
61+
name
62+
}
63+
... on ArticleItem {
64+
title
65+
}
5766
}
5867
}
5968
```
@@ -181,9 +190,9 @@ To get the IDs and names of all Fields in the `article` content type:
181190
{
182191
content {
183192
_types {
184-
article{
193+
article {
185194
_info {
186-
fieldDefinitions{
195+
fieldDefinitions {
187196
id
188197
name
189198
}
@@ -318,8 +327,8 @@ Alternatively, you can query the `children` property of an `item` or `content` o
318327

319328
```
320329
{
321-
item (locationId: 2) {
322-
_location{
330+
item(locationId: 2) {
331+
_location {
323332
children {
324333
edges {
325334
node {

0 commit comments

Comments
 (0)