@@ -145,13 +145,13 @@ type Query {
145145 resultroot : " values[]"
146146
147147 # Ecmascript (with empty endpoint) is used to mimic the response from a REST api.
148- # Note ECMAScript is only used to generate a mock response with customer objects and page number metadata,
148+ # Note ECMAScript is only used to generate a mock response with customer objects and offset metadata,
149149 # using @rest against a real endpoint would not typically require any ECMAScript.
150150 endpoint : " stepzen:empty"
151151 ecmascript : " " "
152152 function transformREST() {
153153 // A total of 23 items will be returned
154- const totalItems = 23;
154+ const records = 23;
155155
156156 // Pagination field arguments
157157 // Since this is OFFSET pagination
@@ -161,12 +161,9 @@ type Query {
161161 const limit = get('first');
162162 const offset = get('after');
163163
164- // metadata - total number of records
165- const records = Math.ceil(totalItems / limit)
166-
167164 // generate customers for nodes based on the limit and offset values
168165 const startIndex = offset+1 || 1;
169- const endIndex = Math.min(startIndex + limit, totalItems +1);
166+ const endIndex = Math.min(startIndex + limit, records +1);
170167 var customers = []
171168 for (let i = startIndex; i < endIndex; i++) {
172169 customers.push({
@@ -180,7 +177,7 @@ type Query {
180177 // when pagination is through an offset.
181178 // @rest must be configured to match the REST response layout.
182179 //
183- // pagination setters defines that the page count
180+ // pagination setters defines that total number of records
184181 // is taken from meta.records
185182 //
186183 // resultroot corresponds to the location that contains the
0 commit comments