Merge pull request #2226 from aissa-bouguern/patch-1

GraphQL many-to-many querying symmetry
This commit is contained in:
Jim LAURIE 2018-11-05 17:24:11 +01:00 committed by GitHub
commit 2fbb53ce69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -398,7 +398,7 @@ module.exports = {
queryOpts.skip = convertedParams.start; queryOpts.skip = convertedParams.start;
switch (association.nature) { switch (association.nature) {
case 'manyToMany': { case 'manyToMany':
if (association.dominant) { if (association.dominant) {
const arrayOfIds = (obj[association.alias] || []).map( const arrayOfIds = (obj[association.alias] || []).map(
related => { related => {
@ -413,7 +413,6 @@ module.exports = {
[ref.primaryKey]: arrayOfIds, [ref.primaryKey]: arrayOfIds,
...where.where, ...where.where,
}).where; }).where;
}
break; break;
// falls through // falls through
} }