i am writing a backend plugin for grafana and I would like to have one of the queries QueryEditor AsyncSelect retrieve a dynamic list of values that it can acquire from the data source. the best I could find to set the queryeditor variables from the datasource plugin (after fetching results) is here - Add support for variables in plugins | Grafana Labs - but its in typescript and mine is written using the go sdk.
this is as far as i got
<AsyncSelect
loadOptions={this.loadAsyncOptions}
defaultOptions
value={value}
onChange={this.onSelectChange}
/>
loadAsyncOptions = () => {
return new Promise<Array<SelectableValue<string>>>((resolve) => {
setTimeout(() => {
const { onRunQuery, } = this.props
resolve([
...this.additional_options
]);
onRunQuery();
}, 2000);
});
};
Can anyone help point me in the right direction?
Thanks