Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of backend query migration #340

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
more changes
andresmgot committed Sep 13, 2024
commit 67f91f6a22088d08cfa16a4a9a6f44f8c657c02a
6 changes: 3 additions & 3 deletions examples/datasource-http-backend/src/datasource.ts
Original file line number Diff line number Diff line change
@@ -26,9 +26,9 @@ export class DataSource extends DataSourceWithBackend<MyQuery, MyDataSourceOptio
};

let url = '/api/ds/query/convert';
// if (config.featureToggles.grafanaAPIServerWithExperimentalAPIs) {
// url = `/apis/example-httpbackend.datasource.grafana.app/v0alpha1/namespaces/stack-1/connections/${this.uid}/query-convert`;
// }
if (config.featureToggles.grafanaAPIServerWithExperimentalAPIs) {
url = `/apis/example-httpbackend.datasource.grafana.app/v0alpha1/namespaces/stack-1/connections/${this.uid}/query-convert`;
}
const response = await getBackendSrv().post(url, request);
return response.queries[0].JSON;
}