From 5a99aff7b8d1e39061390e38767855a9ec201bf5 Mon Sep 17 00:00:00 2001 From: Kristina Date: Wed, 2 Nov 2022 09:50:10 -0500 Subject: [PATCH] construct the datasource for the example query if not added (#57936) --- public/app/features/query/components/QueryEditorRow.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/app/features/query/components/QueryEditorRow.tsx b/public/app/features/query/components/QueryEditorRow.tsx index e3ba2ab298a..470eff3d587 100644 --- a/public/app/features/query/components/QueryEditorRow.tsx +++ b/public/app/features/query/components/QueryEditorRow.tsx @@ -318,6 +318,10 @@ export class QueryEditorRow extends PureComponent { + 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,