diff --git a/packages/grafana-runtime/src/utils/DataSourceWithBackend.ts b/packages/grafana-runtime/src/utils/DataSourceWithBackend.ts index 0046c4aaa12..c4ee525d5f7 100644 --- a/packages/grafana-runtime/src/utils/DataSourceWithBackend.ts +++ b/packages/grafana-runtime/src/utils/DataSourceWithBackend.ts @@ -160,6 +160,13 @@ class DataSourceWithBackend< */ filterQuery?(query: TQuery): boolean; + /** + * Apply template variables for explore + */ + interpolateVariablesInQueries(queries: TQuery[], scopedVars: ScopedVars | {}): TQuery[] { + return queries.map((q) => this.applyTemplateVariables(q, scopedVars) as TQuery); + } + /** * Override to apply template variables. The result is usually also `TQuery`, but sometimes this can * be used to modify the query structure before sending to the backend.