diff --git a/public/app/features/query/components/QueryGroup.tsx b/public/app/features/query/components/QueryGroup.tsx index 54bd6c25e87..c3cb601104c 100644 --- a/public/app/features/query/components/QueryGroup.tsx +++ b/public/app/features/query/components/QueryGroup.tsx @@ -99,7 +99,8 @@ export class QueryGroup extends PureComponent { async componentDidUpdate() { const { options } = this.props; - if (this.state.dataSource && options.dataSource.uid !== this.state.dataSource?.uid) { + const currentDS = await getDataSourceSrv().get(options.dataSource); + if (this.state.dataSource && currentDS.uid !== this.state.dataSource?.uid) { this.setNewQueriesAndDatasource(options); } }