simple-graphql
Advanced tools
Comparing version 1.0.13 to 1.0.14
{ | ||
"name": "simple-graphql", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "The simple way to generates GraphQL schemas and Sequelize models from your models definition.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -17,3 +17,3 @@ "use strict"; | ||
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dbModel, args) { | ||
var after, _args$first, first, before, last, _args$include, include, _args$condition, condition, _args$sort, sort, reverse, count, offset, result, index; | ||
var after, _args$first, first, before, last, _args$include, include, _args$condition, condition, _args$sort, sort, reverse, count, offset, result, index, startCursor, endCursor; | ||
@@ -42,2 +42,3 @@ return regeneratorRuntime.wrap(function _callee$(_context) { | ||
first = last || 100; | ||
before = before || count + 1; | ||
after = count - (parseInt(before) - 1); | ||
@@ -66,4 +67,13 @@ sort = sort.map(function (s) { | ||
index = 0; | ||
startCursor = offset + 1; | ||
endCursor = offset + result.length; | ||
if (reverse) { | ||
startCursor = count - startCursor + 1; | ||
endCursor = count - endCursor + 1; | ||
} | ||
return _context.abrupt("return", { | ||
pageInfo: { | ||
startCursor: startCursor, | ||
endCursor: endCursor, | ||
hasPreviousPage: offset > 0, | ||
@@ -86,3 +96,3 @@ hasNextPage: offset + result.length < count | ||
case 12: | ||
case 15: | ||
case "end": | ||
@@ -89,0 +99,0 @@ return _context.stop(); |
{ | ||
"name": "simple-graphql", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "The simple way to generates GraphQL schemas and Sequelize models from your models definition.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
304224
5259