File tree Expand file tree Collapse file tree 1 file changed +45
-4
lines changed
modules/ROOT/pages/queries-aggregations Expand file tree Collapse file tree 1 file changed +45
-4
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,10 @@ Aggregations on a type are provided in the field `aggregate` inside Connection:
4949query {
5050 usersConnection {
5151 aggregate {
52- name {
53- longest
52+ node {
53+ name {
54+ longest
55+ }
5456 }
5557 }
5658 }
9496query {
9597 postsConnection {
9698 aggregate {
97- createdAt {
98- min
99+ node {
100+ createdAt {
101+ min
102+ }
99103 }
100104 }
101105 }
@@ -220,3 +224,40 @@ query {
220224}
221225----
222226
227+
228+ == Aggregations and pagination
229+
230+ Since aggregations are done within the `Connection` type, the optional arguments `first` and `after` are available for pagination.
231+ However, pagination **does not** apply to aggregations.
232+
233+ For example:
234+
235+ [source, graphql, indent=0]
236+ ----
237+ query {
238+ usersConnection(first: 10) {
239+ aggregate {
240+ count {
241+ nodes
242+ }
243+ }
244+ }
245+ }
246+ ----
247+
248+ The result returns the count of all the nodes:
249+
250+ [source, json, indent=0]
251+ ----
252+ {
253+ "usersConnection": {
254+ "aggregate": {
255+ "count": {
256+ "nodes": 38
257+ }
258+ }
259+ }
260+ }
261+ ----
262+
263+
You can’t perform that action at this time.
0 commit comments