mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Create a dataloader for every model
This commit is contained in:
parent
61318bbed2
commit
0b21fd4e7f
@ -19,24 +19,13 @@ module.exports = {
|
||||
Object.keys(strapi.models)
|
||||
.filter(model => model !== 'core_store')
|
||||
.forEach(model => {
|
||||
(strapi.models[model].associations || []).forEach(association =>
|
||||
this.createLoader(
|
||||
association.collection || association.model,
|
||||
association.plugin
|
||||
)
|
||||
);
|
||||
this.createLoader(model);
|
||||
});
|
||||
|
||||
// Reproduce the same pattern for each plugin.
|
||||
Object.keys(strapi.plugins).forEach(plugin => {
|
||||
Object.keys(strapi.plugins[plugin].models).forEach(model => {
|
||||
(strapi.plugins[plugin].models[model].associations || []).forEach(
|
||||
association =>
|
||||
this.createLoader(
|
||||
association.collection || association.model,
|
||||
association.plugin
|
||||
)
|
||||
);
|
||||
this.createLoader(model, plugin);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user