Skip to content

Commit f69b0c2

Browse files
authored
fix: read value from constant variables as is (#768)
1 parent 9803c75 commit f69b0c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/DataSource.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,9 @@ export class DataSource extends DataSourceApi<GrafanaQuery, GenericOptions> {
308308
}
309309

310310
const value = match(variable)
311+
.with({ type: 'constant' }, (v) => v.current.value)
311312
.with({ type: P.union('custom', 'query') }, (v) => valueFromVariableWithMultiSupport(v))
312-
.with({ type: P.union('constant', 'datasource', 'groupby', 'interval', 'snapshot', 'textbox') }, (v) =>
313+
.with({ type: P.union('datasource', 'groupby', 'interval', 'snapshot', 'textbox') }, (v) =>
313314
getTemplateSrv().replace('$' + variable.name, scopedVars, 'json')
314315
)
315316
.exhaustive();

0 commit comments

Comments
 (0)