From 3a651a1ec3724ac127c9b7a50861f79edf4e0878 Mon Sep 17 00:00:00 2001 From: Steven Koch <39493141+skoch-tf@users.noreply.github.com> Date: Fri, 3 Jan 2020 13:10:44 +0000 Subject: [PATCH] fix required aggregation column --- src/resolvers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolvers.js b/src/resolvers.js index 71fc2d4..dc2c041 100644 --- a/src/resolvers.js +++ b/src/resolvers.js @@ -80,7 +80,7 @@ export function resolvers( ] = association.target.options.gqMiddleware.queryCount( (parent, args, context, info) => { return parent['get' + associationFieldNameType]({ - attributes: [[sequelize.fn('count'), 'cnt']], + attributes: [[sequelize.fn('count', '*'), 'cnt']], ...generateFindArgs(sequelize, args), }).then(result => result[0].get('cnt')); }