mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
console: cache old browse rows introspection calls using react-query
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9101 GitOrigin-RevId: c427bc21d9eec085e38622e4c55b0f597d0ea6f4
This commit is contained in:
parent
3ce9c0f4c3
commit
7154855437
@ -16,11 +16,10 @@ import {
|
||||
} from './LegacyRunQueryContainer.utils';
|
||||
import { LegacyRunQuery } from './LegacyRunQuery';
|
||||
import { FiltersAndSortFormValues, UserQuery } from '../types';
|
||||
import { useLegacyTableColumns } from '../hooks/useLegacyTableColumns';
|
||||
import { useTableName } from '../hooks/useTableName';
|
||||
import { useDatabaseOperators } from '../hooks/useDatabaseOperators';
|
||||
import { useTableSchema } from '../hooks/useTableSchema';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { useTableColumns } from '../../../hooks';
|
||||
import { getTableDisplayName } from '../../../../DatabaseRelationships';
|
||||
|
||||
type LegacyRunQueryContainerProps = {
|
||||
onRunQuery: (userQuery: UserQuery) => void | null;
|
||||
@ -73,8 +72,13 @@ export const LegacyRunQueryContainer = ({
|
||||
) as any;
|
||||
const limit = curFilter.limit;
|
||||
|
||||
const tableColumns = useLegacyTableColumns({ dataSourceName, table });
|
||||
const tableOperators = useDatabaseOperators({ dataSourceName });
|
||||
const {
|
||||
data: {
|
||||
columns: tableColumns = [],
|
||||
supportedOperators: tableOperators = [],
|
||||
} = {},
|
||||
} = useTableColumns({ dataSourceName, table });
|
||||
// const tableOperators = useDatabaseOperators({ dataSourceName });
|
||||
const tableSchema = useTableSchema(table);
|
||||
|
||||
const onSubmit = (userQuery: UserQuery) => {
|
||||
@ -97,7 +101,7 @@ export const LegacyRunQueryContainer = ({
|
||||
);
|
||||
};
|
||||
|
||||
const tableName = useTableName({ dataSourceName, table });
|
||||
const tableName = getTableDisplayName(table);
|
||||
const onExportData = (
|
||||
type: 'CSV' | 'JSON',
|
||||
formValues: FiltersAndSortFormValues
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { DEFAULT_STALE_TIME } from '../../DatabaseRelationships';
|
||||
import { DataSource, Feature } from '../../DataSource';
|
||||
import { DEFAULT_STALE_TIME } from '../../hasura-metadata-api/useMetadata';
|
||||
import { Table } from '../../hasura-metadata-types';
|
||||
import { useHttpClient } from '../../Network';
|
||||
import { useQuery } from 'react-query';
|
||||
|
@ -53,5 +53,6 @@ export function useMetadata(
|
||||
queryFn,
|
||||
...queryOptions,
|
||||
select: d => transformFn(select(d)),
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user