This is documentation for the next version of Grafana. For the latest stable release, go to the latest version.

API Reference@grafana/runtimetoDataQueryResponse

toDataQueryResponse() function

toDataQueryResponse() function

Parse the results from /api/ds/query into a DataQueryResponse

Signature

export declare function toDataQueryResponse(res: {
    data: BackendDataSourceResponse | undefined;
} | FetchResponse<BackendDataSourceResponse | undefined> | DataQueryError, queries?: DataQuery[]): DataQueryResponse;

Import

import { toDataQueryResponse } from '@grafana/runtime';

Parameters

Parameter Type Description
res {
data: BackendDataSourceResponse | undefined;
} | FetchResponse<BackendDataSourceResponse | undefined> | DataQueryError
the HTTP response data.
queries DataQuery[] optional DataQuery array that will order the response based on the order of query refId’s.

Returns:

DataQueryResponse