diff --git a/packages/strapi-plugin-graphql/services/Aggregator.js b/packages/strapi-plugin-graphql/services/Aggregator.js index 6fffd05d0b..09a9139fa3 100644 --- a/packages/strapi-plugin-graphql/services/Aggregator.js +++ b/packages/strapi-plugin-graphql/services/Aggregator.js @@ -358,12 +358,12 @@ const formatConnectionAggregator = function(fields, model, modelName) { if (opts._q) { // allow search param - return strapi.query(modelName).countSearch(opts); + return strapi.query(modelName, model.plugin).countSearch(opts); } - return strapi.query(modelName).count(opts); + return strapi.query(modelName, model.plugin).count(opts); }, totalCount(obj, options, context) { - return strapi.query(modelName).count({}); + return strapi.query(modelName, model.plugin).count({}); }, }, };