Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Enterprise Open source

toDataQueryResponse() function

toDataQueryResponse() function

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

Signature

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

Import

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

Parameters

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

Returns:

DataQueryResponse