simple-graphql
Advanced tools
Comparing version 1.0.14 to 1.0.15
@@ -372,3 +372,4 @@ 'use strict'; | ||
as: key, | ||
foreignKey: config.foreignField + 'Id' | ||
foreignKey: config.foreignKey || config.foreignField + 'Id', | ||
sourceKey: config.sourceKey || undefined | ||
})); | ||
@@ -375,0 +376,0 @@ }); |
{ | ||
"name": "simple-graphql", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "The simple way to generates GraphQL schemas and Sequelize models from your models definition.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -46,3 +46,3 @@ 'use strict'; | ||
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(root, args, context, info, models) { | ||
var condition, sort; | ||
var condition, sort, sourceKey, foreignKey; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -61,7 +61,11 @@ while (1) { | ||
condition[config.foreignField + 'Id'] = root.id; | ||
sourceKey = config.sourceKey || 'id'; | ||
foreignKey = config.foreignKey || config.foreignField + 'Id'; | ||
condition[foreignKey] = root[sourceKey]; | ||
// } | ||
return _context.abrupt('return', (0, _resolveConnection2.default)(models[config.target], _extends({}, args, { condition: condition, sort: sort }))); | ||
case 4: | ||
case 6: | ||
case 'end': | ||
@@ -68,0 +72,0 @@ return _context.stop(); |
{ | ||
"name": "simple-graphql", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"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
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
304694
5262