create groupBy resolver + mock groupBy service (#14530)
To test :
```
query :
query companiesGroupBy($groupBy: CompanyGroupByInput){
companiesGroupBy(groupBy: $groupBy){
groupByDimensionValues
countEmptyId
sumAnnualRecurringRevenueAmountMicros
countEmptyAddress
percentageEmptySearchVector
}
}
input :
{"groupBy": {"name": true, "employees": true, "domainName": {"primaryLinkUrl": true}}}
response :
{
"data": {
"companiesGroupBy": [
{
"groupByDimensionValues": [
"Text 1",
"twenty.com",
"1"
],
"countEmptyId": 39,
"sumAnnualRecurringRevenueAmountMicros": 20,
"countEmptyAddress": 56,
"percentageEmptySearchVector": 88
},
{
"groupByDimensionValues": [
"Long long long long and long text 2",
"github.com/twentyhq/twenty",
"2"
],
"countEmptyId": 20,
"sumAnnualRecurringRevenueAmountMicros": 56,
"countEmptyAddress": 88,
"percentageEmptySearchVector": 2
},
{
"groupByDimensionValues": [
"Text 3",
"react.dev",
"3"
],
"countEmptyId": 56,
"sumAnnualRecurringRevenueAmountMicros": 88,
"countEmptyAddress": 2,
"percentageEmptySearchVector": 39
}
]
}
}
```
closes https://github.com/twentyhq/core-team-issues/issues/1439
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
import { type IConnection } from 'src/engine/api/graphql/workspace-query-runner/interfaces/connection.interface';
|
||||
import { type IEdge } from 'src/engine/api/graphql/workspace-query-runner/interfaces/edge.interface';
|
||||
|
||||
export type IGroupByConnection<
|
||||
T,
|
||||
CustomEdge extends IEdge<T> = IEdge<T>,
|
||||
> = IConnection<T, CustomEdge> & {
|
||||
groupByDimensionValues: string[];
|
||||
};
|
||||
Reference in New Issue
Block a user