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,