mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
18 lines
503 B
TypeScript
18 lines
503 B
TypeScript
|
|
import { createApi } from '@reduxjs/toolkit/query/react';
|
||
|
|
|
||
|
|
import { QueryTemplate } from '../types';
|
||
|
|
|
||
|
|
import { convertDataQueryResponseToQueryTemplates } from './mappers';
|
||
|
|
import { baseQuery } from './query';
|
||
|
|
|
||
|
|
export const queryLibraryApi = createApi({
|
||
|
|
baseQuery,
|
||
|
|
endpoints: (builder) => ({
|
||
|
|
allQueryTemplates: builder.query<QueryTemplate[], void>({
|
||
|
|
query: () => undefined,
|
||
|
|
transformResponse: convertDataQueryResponseToQueryTemplates,
|
||
|
|
}),
|
||
|
|
}),
|
||
|
|
reducerPath: 'queryLibrary',
|
||
|
|
});
|