simple-graphql
Advanced tools
Comparing version 0.2.9 to 0.2.10
@@ -108,3 +108,3 @@ 'use strict'; | ||
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(model, args) { | ||
var after, _args$first, first, before, last, _args$condition, condition, _args$sort, sort, keywords, reverse, _fields, _value, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _field, count, offset, result, index; | ||
var after, _args$first, first, before, last, _args$condition, condition, _args$sort, sort, keywords, reverse, _fields, _value, keywordsCondition, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _field, count, offset, result, index; | ||
@@ -119,3 +119,3 @@ return regeneratorRuntime.wrap(function _callee$(_context) { | ||
if (!keywords) { | ||
_context.next = 23; | ||
_context.next = 25; | ||
break; | ||
@@ -125,6 +125,7 @@ } | ||
_fields = keywords.fields, _value = keywords.value; | ||
keywordsCondition = {}; | ||
_iteratorNormalCompletion = true; | ||
_didIteratorError = false; | ||
_iteratorError = undefined; | ||
_context.prev = 7; | ||
_context.prev = 8; | ||
@@ -134,16 +135,16 @@ for (_iterator = _fields[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
condition[_field] = { $like: '%' + _value + '%' }; | ||
keywordsCondition[_field] = { $like: '%' + _value + '%' }; | ||
} | ||
_context.next = 15; | ||
_context.next = 16; | ||
break; | ||
case 11: | ||
_context.prev = 11; | ||
_context.t0 = _context['catch'](7); | ||
case 12: | ||
_context.prev = 12; | ||
_context.t0 = _context['catch'](8); | ||
_didIteratorError = true; | ||
_iteratorError = _context.t0; | ||
case 15: | ||
_context.prev = 15; | ||
case 16: | ||
_context.prev = 16; | ||
_context.prev = 17; | ||
@@ -154,7 +155,7 @@ if (!_iteratorNormalCompletion && _iterator.return) { | ||
case 18: | ||
_context.prev = 18; | ||
case 19: | ||
_context.prev = 19; | ||
if (!_didIteratorError) { | ||
_context.next = 21; | ||
_context.next = 22; | ||
break; | ||
@@ -165,10 +166,13 @@ } | ||
case 21: | ||
return _context.finish(18); | ||
case 22: | ||
return _context.finish(15); | ||
return _context.finish(19); | ||
case 23: | ||
_context.next = 25; | ||
return _context.finish(16); | ||
case 24: | ||
condition.$or = keywordsCondition; | ||
case 25: | ||
_context.next = 27; | ||
return model.count({ | ||
@@ -178,3 +182,3 @@ where: condition | ||
case 25: | ||
case 27: | ||
count = _context.sent; | ||
@@ -195,3 +199,3 @@ | ||
offset = Math.max(after != null ? parseInt(after) : 0, 0); | ||
_context.next = 30; | ||
_context.next = 32; | ||
return model.findAll({ | ||
@@ -206,3 +210,3 @@ where: condition, | ||
case 30: | ||
case 32: | ||
result = _context.sent; | ||
@@ -229,3 +233,3 @@ index = 0; | ||
case 33: | ||
case 35: | ||
case 'end': | ||
@@ -235,3 +239,3 @@ return _context.stop(); | ||
} | ||
}, _callee, this, [[7, 11, 15, 23], [16,, 18, 22]]); | ||
}, _callee, this, [[8, 12, 16, 24], [17,, 19, 23]]); | ||
})); | ||
@@ -238,0 +242,0 @@ |
{ | ||
"name": "simple-graphql", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"description": "The simple way to generates GraphQL schemas and Sequelize models from your models definition.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
{ | ||
"name": "simple-graphql", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"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
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
495013
4755