Skip to content

Commit 7f99aec

Browse files
authored
chore: add totalEdges for Postgres snippet (#91)
* chore: add totalEdges for Postgres snippet * Update api.graphql * test: add totalEdges response values
1 parent 796a4f0 commit 7f99aec

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

dbquery/pagination/api.graphql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ the starting point).
2626
type CustomerConnection {
2727
edges: [CustomerEdge]
2828
pageInfo: PageInfo!
29+
30+
"""
31+
Total number of edges, will be `null` if the value cannot be determined.
32+
"""
33+
totalEdges: Int
2934
}
3035

3136
"""

dbquery/pagination/operations.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ query Customers($first: Int!, $after: String = "") {
1111
endCursor
1212
hasNextPage
1313
}
14+
totalEdges
1415
}
1516
}

dbquery/pagination/tests/Test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ describe(testDescription, function () {
4141
pageInfo: {
4242
hasNextPage: true,
4343
endCursor: CURSOR
44-
}
44+
},
45+
totalEdges: 10
4546
}
4647
},
4748
},
@@ -72,7 +73,8 @@ describe(testDescription, function () {
7273
pageInfo: {
7374
endCursor: "eyJjIjoiTDpRdWVyeTpjdXN0b21lcnMiLCJvIjozfQ==",
7475
hasNextPage: true
75-
}
76+
},
77+
totalEdges: 10
7678
}
7779
},
7880
},

0 commit comments

Comments
 (0)