Skip to content

QueryBuilder🔗

Constructor🔗

new QueryBuilder()

Methods🔗

build🔗

Builds the object.

build()

datasource🔗

New type for datasource reference

Not creating a new type until we figure out how to handle DS refs for group by, adhoc, and every place that uses DataSourceRef in TS.

datasource(ref: {
    name?: string;
})

hide🔗

If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.

hide(hide: boolean)

panelId🔗

Panel ID from wich the queries will be reused.

panelId(panelId: number)

queryType🔗

Specify the query flavor

TODO make this required and give it a default

queryType(queryType: string)

refId🔗

A unique identifier for the query within the list of targets.

In server side expressions, the refId is used as a variable name to identify results.

By default, the UI will assign A->Z; however setting meaningful names may be useful.

refId(refId: string)

version🔗

version(version: string)

withTransforms🔗

withTransforms(withTransforms: boolean)

See also🔗