Skip to content

Commit 3f119c1

Browse files
author
Jan Lenoch
authored
Merge pull request #15 from Kentico/avoid-debug-property
Avoid using the "debug" property
2 parents f74f8d2 + 87c50fb commit 3f119c1

File tree

6 files changed

+929
-1098
lines changed

6 files changed

+929
-1098
lines changed

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ You can use the GraphiQL interface to experiment with the data structures produc
4040
}
4141
contentType {
4242
elements {
43-
name___teaser_image__name {
44-
name
45-
}
43+
name
44+
codename
45+
type
4646
}
4747
}
4848
}
@@ -87,17 +87,37 @@ Each Linked items property is accompanied by a sibling property suffixed with `_
8787
node {
8888
elements {
8989
related_project_references {
90-
value
90+
system {
91+
codename
92+
}
9193
}
9294
related_project_references_nodes {
93-
...
95+
__typename
96+
... on KenticoCloudItemBlogpostReference {
97+
elements {
98+
name___teaser_image__name {
99+
value
100+
}
101+
}
102+
}
103+
... on KenticoCloudItemProjectReference {
104+
elements {
105+
name___teaser_image__name {
106+
value
107+
}
108+
}
109+
}
94110
}
95111
}
96112
}
97113
}
98114
}
99115
}
100116

117+
Under the `related_project_references` you'd find just the original data served by our [JS SDK](https://github.com/Enngage/kentico-cloud-js). Conversely, the `related_project_refereces_nodes` will give you the full-fledged Gatsby GraphQL nodes with all additional properties and links.
118+
119+
Should a *Linked items* element in KC contain items of only *one* type, you'll be able to specify elements and other properties of that type directly (directly under the `related_project_references_nodes` in the above example). However, once you add linked items of multiple types, you'll have to specify their properties using the `... on [type name]` syntax (so called "inline fragments" in the GraphQL terminology).
120+
101121
#### Content items in Rich text elements relationships
102122

103123
As with the previous example, all rich text properties with inline content items also have an accompanying `_nodes` property.

0 commit comments

Comments
 (0)