20 lines
406 B
TypeScript
20 lines
406 B
TypeScript
import { useQuery } from '@apollo/client';
|
|
import { IJSONObject } from 'types';
|
|
|
|
import { GET_CONFIG } from 'graphql/queries/get-config.ee';
|
|
|
|
type QueryResponse = {
|
|
getConfig: IJSONObject;
|
|
};
|
|
|
|
export default function useConfig(keys?: string[]) {
|
|
const { data, loading } = useQuery<QueryResponse>(GET_CONFIG, {
|
|
variables: { keys },
|
|
});
|
|
|
|
return {
|
|
config: data?.getConfig,
|
|
loading,
|
|
};
|
|
}
|