diff --git a/dbquery/pagination/api.graphql b/dbquery/pagination/api.graphql index 1c7b752..f127aa9 100644 --- a/dbquery/pagination/api.graphql +++ b/dbquery/pagination/api.graphql @@ -26,6 +26,11 @@ the starting point). type CustomerConnection { edges: [CustomerEdge] pageInfo: PageInfo! + + """ + Total number of edges, will be `null` if the value cannot be determined. + """ + totalEdges: Int } """ diff --git a/dbquery/pagination/operations.graphql b/dbquery/pagination/operations.graphql index fc4852c..239c741 100644 --- a/dbquery/pagination/operations.graphql +++ b/dbquery/pagination/operations.graphql @@ -11,5 +11,6 @@ query Customers($first: Int!, $after: String = "") { endCursor hasNextPage } + totalEdges } } diff --git a/dbquery/pagination/tests/Test.js b/dbquery/pagination/tests/Test.js index 6c35d31..93002f3 100644 --- a/dbquery/pagination/tests/Test.js +++ b/dbquery/pagination/tests/Test.js @@ -41,7 +41,8 @@ describe(testDescription, function () { pageInfo: { hasNextPage: true, endCursor: CURSOR - } + }, + totalEdges: 10 } }, }, @@ -72,7 +73,8 @@ describe(testDescription, function () { pageInfo: { endCursor: "eyJjIjoiTDpRdWVyeTpjdXN0b21lcnMiLCJvIjozfQ==", hasNextPage: true - } + }, + totalEdges: 10 } }, },