fix(graphql): filter out orphaned relationships (#7363)

Signed-off-by: Adam Lee <admosity@users.noreply.github.com>
This commit is contained in:
Adam 2020-08-07 09:55:53 -04:00 committed by GitHub
parent ad68fbb7b5
commit c8dc074d3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -212,7 +212,7 @@ const createAggregationFieldsResolver = function(model, fields, operation, typeC
* Correctly format the data returned by the group by
*/
const preProcessGroupByData = function({ result, fieldKey, filters }) {
const _result = _.toArray(result);
const _result = _.toArray(result).filter(value => Boolean(value._id));
return _.map(_result, value => {
return {
key: value._id.toString(),