feat: added countTrue and countFalse (#10741)

fix: #10603 


https://www.loom.com/share/cebc8a19bd8e4ae684a5a215d0fd1f94?sid=cadaa395-285c-45c9-b3ce-2ae6d1330a3c

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
Paribesh Nepal
2025-03-14 12:04:21 +05:30
committed by GitHub
parent 7f8ab6dda5
commit 1bffe57f6b
15 changed files with 386 additions and 8 deletions

View File

@ -98,6 +98,24 @@ export const getAvailableAggregationsFromObjectFields = (
}
switch (field.type) {
case FieldMetadataType.BOOLEAN:
acc[`countTrue${capitalize(field.name)}`] = {
type: GraphQLInt,
description: `Count of true values in the field ${field.name}`,
fromField: field.name,
fromFieldType: field.type,
aggregateOperation: AGGREGATE_OPERATIONS.countTrue,
};
acc[`countFalse${capitalize(field.name)}`] = {
type: GraphQLInt,
description: `Count of false values in the field ${field.name}`,
fromField: field.name,
fromFieldType: field.type,
aggregateOperation: AGGREGATE_OPERATIONS.countFalse,
};
break;
case FieldMetadataType.NUMBER:
acc[`min${capitalize(field.name)}`] = {
type: GraphQLFloat,