Fix relay lint in components and pages

Remove unused GraphQL fields (createdAt, updatedAt, totalCount,
__id, sourceId, etc.) from queries and fragments across 50+ files.

Add TypeScript generics to useMutation, usePaginationFragment,
useRefetchableFragment, and useLazyLoadQuery calls to satisfy
relay/generated-typescript-types.

Add justified eslint-disable comments for fields needed by Relay
cache normalization (id) or consumed by sibling components through
fragment spreads.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-15 13:32:43 +01:00
parent d263cda3f6
commit 13ca50df68
55 changed files with 158 additions and 132 deletions

View File

@@ -30,7 +30,6 @@ const linkedDocumentFragment = graphql`
fragment LinkedDocumentsCardFragment on Document {
id
title
createdAt
documentType
versions(first: 1) {
edges {

View File

@@ -21,6 +21,7 @@ import type {
LinkedDocumentsDialogFragment$key,
} from "#/__generated__/core/LinkedDocumentsDialogFragment.graphql";
import type { LinkedDocumentsDialogQuery } from "#/__generated__/core/LinkedDocumentsDialogQuery.graphql";
import type { LinkedDocumentsDialogQuery_fragment } from "#/__generated__/core/LinkedDocumentsDialogQuery_fragment.graphql";
import { useOrganizationId } from "#/hooks/useOrganizationId";
import type { NodeOf } from "#/types";
@@ -96,10 +97,11 @@ function LinkedDocumentsDialogContent(props: Omit<Props, "children">) {
},
{ fetchPolicy: "network-only" },
);
const { data, loadNext, hasNext, isLoadingNext } = usePaginationFragment(
documentsFragment,
query.organization as LinkedDocumentsDialogFragment$key,
);
const { data, loadNext, hasNext, isLoadingNext }
= usePaginationFragment<LinkedDocumentsDialogQuery_fragment, LinkedDocumentsDialogFragment$key>(
documentsFragment,
query.organization as LinkedDocumentsDialogFragment$key,
);
const { __ } = useTranslate();
const [search, setSearch] = useState("");
const documents = useMemo(