[DASHBOARDS] Move all the graph computing logic to the backend (#17189)
- Create resolvers for each type of charts which needs data transformation after the group by operation: Bar Chart, Line Chart and Pie Chart - Move all the utils to the backend and refactored some into services This allows all the computation to be done in the backend, improving performances in the frontend.
This commit is contained in:
@@ -380,6 +380,27 @@ export type BarChartConfiguration = {
|
||||
timezone?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type BarChartDataInput = {
|
||||
configuration: Scalars['JSON'];
|
||||
objectMetadataId: Scalars['UUID'];
|
||||
};
|
||||
|
||||
export type BarChartDataOutput = {
|
||||
__typename?: 'BarChartDataOutput';
|
||||
data: Array<Scalars['JSON']>;
|
||||
formattedToRawLookup: Scalars['JSON'];
|
||||
groupMode: BarChartGroupMode;
|
||||
hasTooManyGroups: Scalars['Boolean'];
|
||||
indexBy: Scalars['String'];
|
||||
keys: Array<Scalars['String']>;
|
||||
layout: BarChartLayout;
|
||||
series: Array<BarChartSeries>;
|
||||
showDataLabels: Scalars['Boolean'];
|
||||
showLegend: Scalars['Boolean'];
|
||||
xAxisLabel: Scalars['String'];
|
||||
yAxisLabel: Scalars['String'];
|
||||
};
|
||||
|
||||
/** Display mode for bar charts with secondary grouping */
|
||||
export enum BarChartGroupMode {
|
||||
GROUPED = 'GROUPED',
|
||||
@@ -392,6 +413,12 @@ export enum BarChartLayout {
|
||||
VERTICAL = 'VERTICAL'
|
||||
}
|
||||
|
||||
export type BarChartSeries = {
|
||||
__typename?: 'BarChartSeries';
|
||||
key: Scalars['String'];
|
||||
label: Scalars['String'];
|
||||
};
|
||||
|
||||
export type Billing = {
|
||||
__typename?: 'Billing';
|
||||
billingUrl?: Maybe<Scalars['String']>;
|
||||
@@ -1851,6 +1878,35 @@ export type LineChartConfiguration = {
|
||||
timezone?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type LineChartDataInput = {
|
||||
configuration: Scalars['JSON'];
|
||||
objectMetadataId: Scalars['UUID'];
|
||||
};
|
||||
|
||||
export type LineChartDataOutput = {
|
||||
__typename?: 'LineChartDataOutput';
|
||||
formattedToRawLookup: Scalars['JSON'];
|
||||
hasTooManyGroups: Scalars['Boolean'];
|
||||
series: Array<LineChartSeries>;
|
||||
showDataLabels: Scalars['Boolean'];
|
||||
showLegend: Scalars['Boolean'];
|
||||
xAxisLabel: Scalars['String'];
|
||||
yAxisLabel: Scalars['String'];
|
||||
};
|
||||
|
||||
export type LineChartDataPoint = {
|
||||
__typename?: 'LineChartDataPoint';
|
||||
x: Scalars['String'];
|
||||
y: Scalars['Float'];
|
||||
};
|
||||
|
||||
export type LineChartSeries = {
|
||||
__typename?: 'LineChartSeries';
|
||||
data: Array<LineChartDataPoint>;
|
||||
id: Scalars['String'];
|
||||
label: Scalars['String'];
|
||||
};
|
||||
|
||||
export type LinkMetadata = {
|
||||
__typename?: 'LinkMetadata';
|
||||
label: Scalars['String'];
|
||||
@@ -3375,6 +3431,27 @@ export type PieChartConfiguration = {
|
||||
timezone?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type PieChartDataInput = {
|
||||
configuration: Scalars['JSON'];
|
||||
objectMetadataId: Scalars['UUID'];
|
||||
};
|
||||
|
||||
export type PieChartDataItem = {
|
||||
__typename?: 'PieChartDataItem';
|
||||
id: Scalars['String'];
|
||||
value: Scalars['Float'];
|
||||
};
|
||||
|
||||
export type PieChartDataOutput = {
|
||||
__typename?: 'PieChartDataOutput';
|
||||
data: Array<PieChartDataItem>;
|
||||
formattedToRawLookup: Scalars['JSON'];
|
||||
hasTooManyGroups: Scalars['Boolean'];
|
||||
showCenterMetric: Scalars['Boolean'];
|
||||
showDataLabels: Scalars['Boolean'];
|
||||
showLegend: Scalars['Boolean'];
|
||||
};
|
||||
|
||||
export type PlaceDetailsResult = {
|
||||
__typename?: 'PlaceDetailsResult';
|
||||
city?: Maybe<Scalars['String']>;
|
||||
@@ -3433,6 +3510,7 @@ export type Query = {
|
||||
agentTurns: Array<AgentTurn>;
|
||||
apiKey?: Maybe<ApiKey>;
|
||||
apiKeys: Array<ApiKey>;
|
||||
barChartData: BarChartDataOutput;
|
||||
billingPortalSession: BillingSessionOutput;
|
||||
chatMessages: Array<AgentMessage>;
|
||||
chatThread: AgentChatThread;
|
||||
@@ -3510,9 +3588,11 @@ export type Query = {
|
||||
getToolIndex: Array<ToolIndexEntry>;
|
||||
index: Index;
|
||||
indexMetadatas: IndexConnection;
|
||||
lineChartData: LineChartDataOutput;
|
||||
listPlans: Array<BillingPlanOutput>;
|
||||
object: Object;
|
||||
objects: ObjectConnection;
|
||||
pieChartData: PieChartDataOutput;
|
||||
search: SearchResultConnection;
|
||||
skill?: Maybe<Skill>;
|
||||
skills: Array<Skill>;
|
||||
@@ -3533,6 +3613,11 @@ export type QueryApiKeyArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QueryBarChartDataArgs = {
|
||||
input: BarChartDataInput;
|
||||
};
|
||||
|
||||
|
||||
export type QueryBillingPortalSessionArgs = {
|
||||
returnUrlPath?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
@@ -3832,6 +3917,11 @@ export type QueryIndexMetadatasArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QueryLineChartDataArgs = {
|
||||
input: LineChartDataInput;
|
||||
};
|
||||
|
||||
|
||||
export type QueryObjectArgs = {
|
||||
id: Scalars['UUID'];
|
||||
};
|
||||
@@ -3843,6 +3933,11 @@ export type QueryObjectsArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QueryPieChartDataArgs = {
|
||||
input: PieChartDataInput;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySearchArgs = {
|
||||
after?: InputMaybe<Scalars['String']>;
|
||||
excludedObjectNameSingulars?: InputMaybe<Array<Scalars['String']>>;
|
||||
|
||||
Reference in New Issue
Block a user