Reduce requested source data in queries

This commit is contained in:
schroda
2024-07-03 23:15:50 +02:00
parent 2fa1de578c
commit 7556ea9b38
18 changed files with 368 additions and 468 deletions

View File

@@ -21,6 +21,8 @@ import { NavBarContext } from '@/components/context/NavbarContext.tsx';
import { LoadingPlaceholder } from '@/components/util/LoadingPlaceholder.tsx';
import { EmptyViewAbsoluteCentered } from '@/components/util/EmptyViewAbsoluteCentered.tsx';
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
import { GetCategoriesSettingsQueryVariables, GetSourceSettingsQuery } from '@/lib/graphql/generated/graphql.ts';
import { GET_SOURCE_SETTINGS } from '@/lib/graphql/queries/SourceQuery.ts';
function getPrefComponent(type: string) {
switch (type) {
@@ -54,7 +56,10 @@ export function SourceConfigure() {
}, [t]);
const { sourceId } = useParams<{ sourceId: string }>();
const { data, loading, error, refetch } = requestManager.useGetSource(sourceId, {
const { data, loading, error, refetch } = requestManager.useGetSource<
GetSourceSettingsQuery,
GetCategoriesSettingsQueryVariables
>(GET_SOURCE_SETTINGS, sourceId, {
notifyOnNetworkStatusChange: true,
});
const sourcePreferences = data?.source.preferences ?? [];