Skip to content

Commit 336d128

Browse files
committed
Update examples
1 parent 0ab4d0e commit 336d128

File tree

1 file changed

+24
-48
lines changed

1 file changed

+24
-48
lines changed

README.md

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,13 @@ Query examples based on The Starter Kit
4545
byType {
4646
People(id: "1116") {
4747
pageTitle
48-
_contentData {
49-
children {
50-
items {
51-
... on Person {
52-
_contentData {
53-
name
54-
}
55-
department
56-
photo {
57-
_contentData {
58-
url
59-
}
60-
}
48+
_children {
49+
items {
50+
... on Person {
51+
_name
52+
department
53+
photo {
54+
_url
6155
}
6256
}
6357
}
@@ -76,19 +70,13 @@ We can also do some simple filtering and sorting, ([Inspired by the Grahpcool fi
7670
byType {
7771
People(id: "1116") {
7872
pageTitle
79-
_contentData {
80-
peopleStartsWithJ: children(filter: {name_starts_with: "J"}, orderBy: name_ASC) {
81-
items {
82-
... on Person {
83-
_contentData {
84-
name
85-
}
86-
department
87-
photo {
88-
_contentData {
89-
url
90-
}
91-
}
73+
peopleStartsWithJ: _children(filter: {_name_starts_with: "J"}, orderBy: _name_ASC) {
74+
items {
75+
... on Person {
76+
_name
77+
department
78+
photo {
79+
_url
9280
}
9381
}
9482
}
@@ -107,11 +95,9 @@ And even query for multiple types at the same time
10795
byType {
10896
People(id: "1116") {
10997
pageTitle
110-
_contentData {
111-
peopleStartsWithJ: children(filter: {name_starts_with: "J"}, orderBy: name_ASC) {
112-
items {
113-
...SimplePerson
114-
}
98+
peopleStartsWithJ: _children(filter: {_name_starts_with: "J"}, orderBy: _name_ASC) {
99+
items {
100+
...SimplePerson
115101
}
116102
}
117103
}
@@ -121,11 +107,9 @@ And even query for multiple types at the same time
121107
featuredProducts {
122108
...SimpleProduct
123109
}
124-
_contentData {
125-
children {
126-
items {
127-
...SimpleProduct
128-
}
110+
_children {
111+
items {
112+
...SimpleProduct
129113
}
130114
}
131115
}
@@ -134,27 +118,19 @@ And even query for multiple types at the same time
134118
}
135119

136120
fragment SimplePerson on Person {
137-
_contentData {
138-
name
139-
}
121+
_name
140122
department
141123
photo {
142-
_contentData {
143-
url
144-
}
124+
_url
145125
}
146126
}
147127

148128
fragment SimpleProduct on Product {
149-
_contentData {
150-
name
151-
}
129+
_name
152130
price
153131
sku
154132
photos {
155-
_contentData {
156-
url
157-
}
133+
_url
158134
}
159135
}
160136
```

0 commit comments

Comments
 (0)