Skip to content

Commit 8ae6409

Browse files
committed
Fix error in grafana 9.6.3
"Object type to query" could not be changed in grafana 9.6.3 error message visible in console was: Uncaught TypeError: "objectType" is read-only objectTypeChange VariableQueryEditor.tsx:46
1 parent 1668962 commit 8ae6409

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ui/VariableQueryEditor.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ export const VariableQueryEditor = function (props: VariableQueryProps) {
4343
}
4444

4545
const objectTypeChange = (value: ObjectType) => {
46-
query.objectType = value;
47-
props.onChange(query, formatDefinition(query));
46+
const newQuery: MetricFindQuery = {
47+
...query,
48+
objectType: value,
49+
};
50+
props.onChange(newQuery, formatDefinition(newQuery));
4851
};
4952

5053
const filtersChange = (value: FiltersRequestSpec) => {

0 commit comments

Comments
 (0)