graphql-sequelize-teselagen
Advanced tools
Comparing version
@@ -98,9 +98,3 @@ 'use strict'; | ||
if (findOptions.include) { | ||
_lodash2.default.each(findOptions.include, function (includeObj) { | ||
if (!includeObj.model) return; | ||
var association = model.associations[typeof includeObj.model === 'string' ? (0, _camelCase2.default)(includeObj.model) : includeObj.model.name]; | ||
includeObj.model = association.target; | ||
includeObj.as = association.as; | ||
}); | ||
findOptions.include = _lodash2.default.toArray(findOptions.include); | ||
buildInclude(findOptions.include, model); | ||
} | ||
@@ -117,2 +111,15 @@ | ||
module.exports = resolverFactory; | ||
module.exports = resolverFactory; | ||
function buildInclude(passedInclude, model) { | ||
_lodash2.default.each(passedInclude, function (includeObj) { | ||
if (!includeObj.model) return; | ||
var association = model.associations[typeof includeObj.model === 'string' ? (0, _camelCase2.default)(includeObj.model) : includeObj.model.name]; | ||
includeObj.model = association.target; | ||
includeObj.as = association.as; | ||
if (includeObj.include) { | ||
buildInclude(includeObj.include, association.target); | ||
} | ||
}); | ||
passedInclude = _lodash2.default.toArray(passedInclude); | ||
} |
{ | ||
"name": "graphql-sequelize-teselagen", | ||
"version": "5.3.5", | ||
"version": "5.3.6", | ||
"description": "GraphQL & Relay for MySQL & Postgres via Sequelize", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
162061
0.08%866
0.7%