mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
Merge pull request #4296 from strapi/fix/graphql-many-many-nested
Check if many-many relation is populated before loading it
This commit is contained in:
commit
2e04629c31
@ -165,8 +165,9 @@ const buildAssocResolvers = (model, name, { plugin }) => {
|
||||
};
|
||||
|
||||
if (
|
||||
(association.nature === 'manyToMany' && association.dominant) ||
|
||||
association.nature === 'manyWay'
|
||||
((association.nature === 'manyToMany' && association.dominant) ||
|
||||
association.nature === 'manyWay') &&
|
||||
_.has(obj, association.alias) // if populated
|
||||
) {
|
||||
_.set(
|
||||
queryOpts,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user