DataSourceWithBackend: implement interpolateVariablesInQueries by default (#41152)

This commit is contained in:
Ryan McKinley 2021-11-02 00:29:52 -07:00 committed by GitHub
parent 418059bc23
commit 340ed4125e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.