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:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user