construct the datasource for the example query if not added (#57936)

This commit is contained in:
Kristina authored and GitHub committed 2022-11-02 09:50:10 -05:00
1 parent 3a5ddbfbdf
commit 5a99aff7b8
1 file changed
+4
@@ -318,6 +318,10 @@ export class QueryEditorRow<TQuery extends DataQuery> extends PureComponent<Prop
};
onClickExample = (query: TQuery) => {
if (query.datasource === undefined) {
query.datasource = { type: this.props.dataSource.type, uid: this.props.dataSource.uid };
}
this.props.onChange({
...query,
refId: this.props.query.refId,