toDataQueryResponse() function

toDataQueryResponse() function

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

Signature

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

Import

  1. 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