|
@@ -13,8 +13,8 @@ import {
|
|
|
AggregationKey,
|
|
|
DISCOVER_FIELDS,
|
|
|
FieldKey,
|
|
|
- FIELDS,
|
|
|
FieldValueType,
|
|
|
+ getFieldDefinition,
|
|
|
MEASUREMENT_FIELDS,
|
|
|
SpanOpBreakdown,
|
|
|
WebVital,
|
|
@@ -1022,8 +1022,10 @@ export function aggregateFunctionOutputType(
|
|
|
|
|
|
// If the function is an inherit type it will have a field as
|
|
|
// the first parameter and we can use that to get the type.
|
|
|
- if (firstArg && FIELDS.hasOwnProperty(firstArg)) {
|
|
|
- return FIELDS[firstArg].valueType as AggregationOutputType;
|
|
|
+ const fieldDef = getFieldDefinition(firstArg ?? '');
|
|
|
+
|
|
|
+ if (fieldDef !== null) {
|
|
|
+ return fieldDef.valueType as AggregationOutputType;
|
|
|
}
|
|
|
|
|
|
if (firstArg && isMeasurement(firstArg)) {
|
|
@@ -1058,8 +1060,10 @@ export function errorsAndTransactionsAggregateFunctionOutputType(
|
|
|
|
|
|
// If the function is an inherit type it will have a field as
|
|
|
// the first parameter and we can use that to get the type.
|
|
|
- if (firstArg && FIELDS.hasOwnProperty(firstArg)) {
|
|
|
- return FIELDS[firstArg].valueType as AggregationOutputType;
|
|
|
+ const fieldDef = getFieldDefinition(firstArg ?? '');
|
|
|
+
|
|
|
+ if (fieldDef !== null) {
|
|
|
+ return fieldDef.valueType as AggregationOutputType;
|
|
|
}
|
|
|
|
|
|
if (firstArg && isMeasurement(firstArg)) {
|
|
@@ -1199,8 +1203,10 @@ export function getColumnType(column: Column): ColumnType {
|
|
|
return outputType;
|
|
|
}
|
|
|
} else if (column.kind === 'field') {
|
|
|
- if (FIELDS.hasOwnProperty(column.field)) {
|
|
|
- return FIELDS[column.field].valueType as ColumnType;
|
|
|
+ const fieldDef = getFieldDefinition(column.field);
|
|
|
+
|
|
|
+ if (fieldDef !== null) {
|
|
|
+ return fieldDef.valueType as ColumnType;
|
|
|
}
|
|
|
if (isMeasurement(column.field)) {
|
|
|
return measurementType(column.field);
|