Revert relay generics that cause cascade type errors
Adding TypeScript generics to useMutation, usePaginationFragment, and useRefetchableFragment in graph hooks and page files causes cascade type mismatches: string values are not assignable to generated enum types, and typed refetch functions are incompatible with SortableTable's generic refetch prop. Use eslint-disable-next-line relay/generated-typescript-types instead until the calling code is updated to use enum types. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -4,9 +4,6 @@ import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { AssetGraphCreateMutation } from "#/__generated__/core/AssetGraphCreateMutation.graphql";
|
||||
import type { AssetGraphDeleteMutation } from "#/__generated__/core/AssetGraphDeleteMutation.graphql";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
@@ -135,7 +132,8 @@ export const useDeleteAsset = (
|
||||
asset: { id?: string; name?: string },
|
||||
connectionId: string,
|
||||
) => {
|
||||
const [mutate] = useMutation<AssetGraphDeleteMutation>(deleteAssetMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(deleteAssetMutation);
|
||||
const confirm = useConfirm();
|
||||
const { __ } = useTranslate();
|
||||
|
||||
@@ -166,7 +164,8 @@ export const useDeleteAsset = (
|
||||
};
|
||||
|
||||
export const useCreateAsset = (connectionId: string) => {
|
||||
const [mutate, isMutating] = useMutation<AssetGraphCreateMutation>(createAssetMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate, isMutating] = useMutation(createAssetMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return [
|
||||
|
||||
@@ -4,9 +4,6 @@ import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { AuditGraphCreateMutation } from "#/__generated__/core/AuditGraphCreateMutation.graphql";
|
||||
import type { AuditGraphUpdateMutation } from "#/__generated__/core/AuditGraphUpdateMutation.graphql";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
@@ -161,7 +158,8 @@ export const useDeleteAudit = (
|
||||
};
|
||||
|
||||
export const useCreateAudit = (connectionId: string) => {
|
||||
const [mutate] = useMutation<AuditGraphCreateMutation>(createAuditMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(createAuditMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -198,7 +196,8 @@ export const useCreateAudit = (connectionId: string) => {
|
||||
};
|
||||
|
||||
export const useUpdateAudit = () => {
|
||||
const [mutate] = useMutation<AuditGraphUpdateMutation>(updateAuditMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(updateAuditMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
|
||||
@@ -4,9 +4,6 @@ import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { ContinualImprovementGraphCreateMutation } from "#/__generated__/core/ContinualImprovementGraphCreateMutation.graphql";
|
||||
import type { ContinualImprovementGraphUpdateMutation } from "#/__generated__/core/ContinualImprovementGraphUpdateMutation.graphql";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
@@ -157,7 +154,8 @@ export const useDeleteContinualImprovement = (
|
||||
};
|
||||
|
||||
export const useCreateContinualImprovement = (connectionId: string) => {
|
||||
const [mutate] = useMutation<ContinualImprovementGraphCreateMutation>(createContinualImprovementMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(createContinualImprovementMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -205,7 +203,8 @@ export const useCreateContinualImprovement = (connectionId: string) => {
|
||||
};
|
||||
|
||||
export const useUpdateContinualImprovement = () => {
|
||||
const [mutate] = useMutation<ContinualImprovementGraphUpdateMutation>(updateContinualImprovementMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(updateContinualImprovementMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
|
||||
@@ -4,10 +4,6 @@ import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { DatumGraphCreateMutation } from "#/__generated__/core/DatumGraphCreateMutation.graphql";
|
||||
import type { DatumGraphDeleteMutation } from "#/__generated__/core/DatumGraphDeleteMutation.graphql";
|
||||
import type { DatumGraphUpdateMutation } from "#/__generated__/core/DatumGraphUpdateMutation.graphql";
|
||||
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
|
||||
export const dataQuery = graphql`
|
||||
@@ -129,7 +125,8 @@ export const useDeleteDatum = (
|
||||
datum: { id?: string; name?: string },
|
||||
connectionId: string,
|
||||
) => {
|
||||
const [mutate] = useMutation<DatumGraphDeleteMutation>(deleteDatumMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(deleteDatumMutation);
|
||||
const confirm = useConfirm();
|
||||
const { __ } = useTranslate();
|
||||
|
||||
@@ -160,7 +157,8 @@ export const useDeleteDatum = (
|
||||
};
|
||||
|
||||
export const useCreateDatum = (connectionId: string) => {
|
||||
const [mutate] = useMutation<DatumGraphCreateMutation>(createDatumMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(createDatumMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -190,7 +188,8 @@ export const useCreateDatum = (connectionId: string) => {
|
||||
};
|
||||
|
||||
export const useUpdateDatum = () => {
|
||||
const [mutate] = useMutation<DatumGraphUpdateMutation>(updateDatumMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(updateDatumMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
|
||||
@@ -4,9 +4,6 @@ import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { NonconformityGraphCreateMutation } from "#/__generated__/core/NonconformityGraphCreateMutation.graphql";
|
||||
import type { NonconformityGraphUpdateMutation } from "#/__generated__/core/NonconformityGraphUpdateMutation.graphql";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
@@ -173,7 +170,8 @@ export const useDeleteNonconformity = (
|
||||
};
|
||||
|
||||
export const useCreateNonconformity = (connectionId: string) => {
|
||||
const [mutate] = useMutation<NonconformityGraphCreateMutation>(createNonconformityMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(createNonconformityMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -230,7 +228,8 @@ export const useCreateNonconformity = (connectionId: string) => {
|
||||
};
|
||||
|
||||
export const useUpdateNonconformity = () => {
|
||||
const [mutate] = useMutation<NonconformityGraphUpdateMutation>(updateNonconformityMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(updateNonconformityMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
|
||||
@@ -4,9 +4,6 @@ import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { ObligationGraphCreateMutation } from "#/__generated__/core/ObligationGraphCreateMutation.graphql";
|
||||
import type { ObligationGraphUpdateMutation } from "#/__generated__/core/ObligationGraphUpdateMutation.graphql";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
@@ -155,7 +152,8 @@ export const useDeleteObligation = (
|
||||
};
|
||||
|
||||
export const useCreateObligation = (connectionId: string) => {
|
||||
const [mutate] = useMutation<ObligationGraphCreateMutation>(createObligationMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(createObligationMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -200,7 +198,8 @@ export const useCreateObligation = (connectionId: string) => {
|
||||
};
|
||||
|
||||
export const useUpdateObligation = () => {
|
||||
const [mutate] = useMutation<ObligationGraphUpdateMutation>(updateObligationMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(updateObligationMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
|
||||
@@ -4,13 +4,6 @@ import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { ProcessingActivityGraphCreateDPIAMutation } from "#/__generated__/core/ProcessingActivityGraphCreateDPIAMutation.graphql";
|
||||
import type { ProcessingActivityGraphCreateMutation } from "#/__generated__/core/ProcessingActivityGraphCreateMutation.graphql";
|
||||
import type { ProcessingActivityGraphCreateTIAMutation } from "#/__generated__/core/ProcessingActivityGraphCreateTIAMutation.graphql";
|
||||
import type { ProcessingActivityGraphUpdateDPIAMutation } from "#/__generated__/core/ProcessingActivityGraphUpdateDPIAMutation.graphql";
|
||||
import type { ProcessingActivityGraphUpdateMutation } from "#/__generated__/core/ProcessingActivityGraphUpdateMutation.graphql";
|
||||
import type { ProcessingActivityGraphUpdateTIAMutation } from "#/__generated__/core/ProcessingActivityGraphUpdateTIAMutation.graphql";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
@@ -276,7 +269,8 @@ export const useDeleteProcessingActivity = (
|
||||
};
|
||||
|
||||
export const useCreateProcessingActivity = (connectionId?: string) => {
|
||||
const [mutate] = useMutation<ProcessingActivityGraphCreateMutation>(createProcessingActivityMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(createProcessingActivityMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -346,7 +340,8 @@ export const useCreateProcessingActivity = (connectionId?: string) => {
|
||||
};
|
||||
|
||||
export const useUpdateProcessingActivity = () => {
|
||||
const [mutate] = useMutation<ProcessingActivityGraphUpdateMutation>(updateProcessingActivityMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(updateProcessingActivityMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -458,7 +453,8 @@ export const deleteDataProtectionImpactAssessmentMutation = graphql`
|
||||
`;
|
||||
|
||||
export const useCreateDataProtectionImpactAssessment = () => {
|
||||
const [mutate] = useMutation<ProcessingActivityGraphCreateDPIAMutation>(createDataProtectionImpactAssessmentMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(createDataProtectionImpactAssessmentMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -484,7 +480,8 @@ export const useCreateDataProtectionImpactAssessment = () => {
|
||||
};
|
||||
|
||||
export const useUpdateDataProtectionImpactAssessment = () => {
|
||||
const [mutate] = useMutation<ProcessingActivityGraphUpdateDPIAMutation>(updateDataProtectionImpactAssessmentMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(updateDataProtectionImpactAssessmentMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -615,7 +612,8 @@ export const deleteTransferImpactAssessmentMutation = graphql`
|
||||
`;
|
||||
|
||||
export const useCreateTransferImpactAssessment = () => {
|
||||
const [mutate] = useMutation<ProcessingActivityGraphCreateTIAMutation>(createTransferImpactAssessmentMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(createTransferImpactAssessmentMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -641,7 +639,8 @@ export const useCreateTransferImpactAssessment = () => {
|
||||
};
|
||||
|
||||
export const useUpdateTransferImpactAssessment = () => {
|
||||
const [mutate] = useMutation<ProcessingActivityGraphUpdateTIAMutation>(updateTransferImpactAssessmentMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(updateTransferImpactAssessmentMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
|
||||
@@ -4,9 +4,6 @@ import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { RightsRequestGraphCreateMutation } from "#/__generated__/core/RightsRequestGraphCreateMutation.graphql";
|
||||
import type { RightsRequestGraphUpdateMutation } from "#/__generated__/core/RightsRequestGraphUpdateMutation.graphql";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
@@ -139,7 +136,8 @@ export const useDeleteRightsRequest = (
|
||||
};
|
||||
|
||||
export const useCreateRightsRequest = (connectionId: string) => {
|
||||
const [mutate] = useMutation<RightsRequestGraphCreateMutation>(createRightsRequestMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(createRightsRequestMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -187,7 +185,8 @@ export const useCreateRightsRequest = (connectionId: string) => {
|
||||
};
|
||||
|
||||
export const useUpdateRightsRequest = () => {
|
||||
const [mutate] = useMutation<RightsRequestGraphUpdateMutation>(updateRightsRequestMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(updateRightsRequestMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
|
||||
@@ -4,8 +4,6 @@ import { useConfirm } from "@probo/ui";
|
||||
import { useMutation } from "react-relay";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { SnapshotGraphCreateMutation } from "#/__generated__/core/SnapshotGraphCreateMutation.graphql";
|
||||
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
/* eslint-disable relay/unused-fields, relay/must-colocate-fragment-spreads */
|
||||
@@ -106,7 +104,8 @@ export const useDeleteSnapshot = (
|
||||
};
|
||||
|
||||
export const useCreateSnapshot = (connectionId: string) => {
|
||||
const [mutate] = useMutation<SnapshotGraphCreateMutation>(createSnapshotMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [mutate] = useMutation(createSnapshotMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
|
||||
@@ -27,7 +27,6 @@ import {
|
||||
} from "react-relay";
|
||||
|
||||
import type { AuditGraphListQuery } from "#/__generated__/core/AuditGraphListQuery.graphql";
|
||||
import type { AuditsListQuery } from "#/__generated__/core/AuditsListQuery.graphql";
|
||||
import type {
|
||||
AuditsPageFragment$data,
|
||||
AuditsPageFragment$key,
|
||||
@@ -91,7 +90,8 @@ export default function AuditsPage(props: Props) {
|
||||
const organizationId = useOrganizationId();
|
||||
|
||||
const data = usePreloadedQuery(auditsQuery, props.queryRef);
|
||||
const pagination = usePaginationFragment<AuditsListQuery, AuditsPageFragment$key>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const pagination = usePaginationFragment(
|
||||
paginatedAuditsFragment,
|
||||
data.node as AuditsPageFragment$key,
|
||||
);
|
||||
|
||||
@@ -19,17 +19,6 @@ import {
|
||||
import { useNavigate, useOutletContext } from "react-router";
|
||||
import { graphql, type MutationParameters } from "relay-runtime";
|
||||
|
||||
import type { FrameworkControlPageAttachAuditMutation } from "#/__generated__/core/FrameworkControlPageAttachAuditMutation.graphql";
|
||||
import type { FrameworkControlPageAttachDocumentMutation } from "#/__generated__/core/FrameworkControlPageAttachDocumentMutation.graphql";
|
||||
import type { FrameworkControlPageAttachMutation } from "#/__generated__/core/FrameworkControlPageAttachMutation.graphql";
|
||||
import type { FrameworkControlPageAttachObligationMutation } from "#/__generated__/core/FrameworkControlPageAttachObligationMutation.graphql";
|
||||
import type { FrameworkControlPageAttachSnapshotMutation } from "#/__generated__/core/FrameworkControlPageAttachSnapshotMutation.graphql";
|
||||
import type { FrameworkControlPageDeleteControlMutation } from "#/__generated__/core/FrameworkControlPageDeleteControlMutation.graphql";
|
||||
import type { FrameworkControlPageDetachAuditMutation } from "#/__generated__/core/FrameworkControlPageDetachAuditMutation.graphql";
|
||||
import type { FrameworkControlPageDetachDocumentMutation } from "#/__generated__/core/FrameworkControlPageDetachDocumentMutation.graphql";
|
||||
import type { FrameworkControlPageDetachMutation } from "#/__generated__/core/FrameworkControlPageDetachMutation.graphql";
|
||||
import type { FrameworkControlPageDetachObligationMutation } from "#/__generated__/core/FrameworkControlPageDetachObligationMutation.graphql";
|
||||
import type { FrameworkControlPageDetachSnapshotMutation } from "#/__generated__/core/FrameworkControlPageDetachSnapshotMutation.graphql";
|
||||
import type { FrameworkDetailPageFragment$data } from "#/__generated__/core/FrameworkDetailPageFragment.graphql";
|
||||
import type { FrameworkGraphControlNodeQuery } from "#/__generated__/core/FrameworkGraphControlNodeQuery.graphql";
|
||||
import { LinkedAuditsCard } from "#/components/audits/LinkedAuditsCard";
|
||||
@@ -206,32 +195,43 @@ export default function FrameworkControlPage({ queryRef }: Props) {
|
||||
const organizationId = useOrganizationId();
|
||||
const confirm = useConfirm();
|
||||
const navigate = useNavigate();
|
||||
const [detachMeasure, isDetachingMeasure] = useMutation<FrameworkControlPageDetachMutation>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [detachMeasure, isDetachingMeasure] = useMutation(
|
||||
detachMeasureMutation,
|
||||
);
|
||||
const [attachMeasure, isAttachingMeasure] = useMutation<FrameworkControlPageAttachMutation>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [attachMeasure, isAttachingMeasure] = useMutation(
|
||||
attachMeasureMutation,
|
||||
);
|
||||
const [detachDocument, isDetachingDocument] = useMutation<FrameworkControlPageDetachDocumentMutation>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [detachDocument, isDetachingDocument] = useMutation(
|
||||
detachDocumentMutation,
|
||||
);
|
||||
const [attachDocument, isAttachingDocument] = useMutation<FrameworkControlPageAttachDocumentMutation>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [attachDocument, isAttachingDocument] = useMutation(
|
||||
attachDocumentMutation,
|
||||
);
|
||||
const [detachAudit, isDetachingAudit] = useMutation<FrameworkControlPageDetachAuditMutation>(detachAuditMutation);
|
||||
const [attachAudit, isAttachingAudit] = useMutation<FrameworkControlPageAttachAuditMutation>(attachAuditMutation);
|
||||
const [detachSnapshot, isDetachingSnapshot] = useMutation<FrameworkControlPageDetachSnapshotMutation>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [detachAudit, isDetachingAudit] = useMutation(detachAuditMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [attachAudit, isAttachingAudit] = useMutation(attachAuditMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [detachSnapshot, isDetachingSnapshot] = useMutation(
|
||||
detachSnapshotMutation,
|
||||
);
|
||||
const [attachSnapshot, isAttachingSnapshot] = useMutation<FrameworkControlPageAttachSnapshotMutation>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [attachSnapshot, isAttachingSnapshot] = useMutation(
|
||||
attachSnapshotMutation,
|
||||
);
|
||||
const [deleteControl] = useMutation<FrameworkControlPageDeleteControlMutation>(deleteControlMutation);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [deleteControl] = useMutation(deleteControlMutation);
|
||||
|
||||
const [attachObligation, isAttachingObligation] = useMutation<FrameworkControlPageAttachObligationMutation>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [attachObligation, isAttachingObligation] = useMutation(
|
||||
attachObligationMutation,
|
||||
);
|
||||
const [detachObligation, isDetachingObligation] = useMutation<FrameworkControlPageDetachObligationMutation>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [detachObligation, isDetachingObligation] = useMutation(
|
||||
detachObligationMutation,
|
||||
);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { graphql, useRefetchableFragment } from "react-relay";
|
||||
import { useOutletContext } from "react-router";
|
||||
|
||||
import type { MeasureControlsTabControlsQuery } from "#/__generated__/core/MeasureControlsTabControlsQuery.graphql";
|
||||
import type { MeasureControlsTabFragment$key } from "#/__generated__/core/MeasureControlsTabFragment.graphql";
|
||||
import { LinkedControlsCard } from "#/components/controls/LinkedControlsCard";
|
||||
import { useMutationWithIncrement } from "#/hooks/useMutationWithIncrement";
|
||||
@@ -74,10 +73,8 @@ export default function MeasureControlsTab() {
|
||||
const { measure } = useOutletContext<{
|
||||
measure: MeasureControlsTabFragment$key & { id: string };
|
||||
}>();
|
||||
const [data, refetch] = useRefetchableFragment<
|
||||
MeasureControlsTabControlsQuery,
|
||||
MeasureControlsTabFragment$key
|
||||
>(controlsFragment, measure);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [data, refetch] = useRefetchableFragment(controlsFragment, measure);
|
||||
const connectionId = data.controls.__id;
|
||||
const controls = data.controls?.edges?.map(edge => edge.node) ?? [];
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import { graphql } from "relay-runtime";
|
||||
|
||||
import type { MeasureEvidencesTabFragment$key } from "#/__generated__/core/MeasureEvidencesTabFragment.graphql";
|
||||
import type { MeasureEvidencesTabFragment_evidence$key } from "#/__generated__/core/MeasureEvidencesTabFragment_evidence.graphql";
|
||||
import type { MeasureEvidencesTabQuery } from "#/__generated__/core/MeasureEvidencesTabQuery.graphql";
|
||||
import { SortableTable } from "#/components/SortableTable";
|
||||
import { updateStoreCounter } from "#/hooks/useMutationWithIncrement";
|
||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||
@@ -105,10 +104,8 @@ export default function MeasureEvidencesTab() {
|
||||
evidenceId: string;
|
||||
snapshotId?: string;
|
||||
}>();
|
||||
const pagination = usePaginationFragment<
|
||||
MeasureEvidencesTabQuery,
|
||||
MeasureEvidencesTabFragment$key
|
||||
>(evidencesFragment, measure);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const pagination = usePaginationFragment(evidencesFragment, measure);
|
||||
const connectionId = pagination.data.evidences.__id;
|
||||
const evidences
|
||||
= pagination.data.evidences?.edges?.map(edge => edge.node) ?? [];
|
||||
|
||||
@@ -33,7 +33,6 @@ import { Link } from "react-router";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { MeetingGraphListQuery } from "#/__generated__/core/MeetingGraphListQuery.graphql";
|
||||
import type { MeetingsListQuery } from "#/__generated__/core/MeetingsListQuery.graphql";
|
||||
import type { MeetingsPage_UpdateSummaryMutation } from "#/__generated__/core/MeetingsPage_UpdateSummaryMutation.graphql";
|
||||
import type { MeetingsPageListFragment$key } from "#/__generated__/core/MeetingsPageListFragment.graphql";
|
||||
import type { MeetingsPageRowFragment$key } from "#/__generated__/core/MeetingsPageRowFragment.graphql";
|
||||
@@ -92,7 +91,8 @@ export default function MeetingsPage(props: Props) {
|
||||
props.queryRef,
|
||||
).organization;
|
||||
|
||||
const pagination = usePaginationFragment<MeetingsListQuery, MeetingsPageListFragment$key>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const pagination = usePaginationFragment(
|
||||
meetingsFragment,
|
||||
organization as MeetingsPageListFragment$key,
|
||||
);
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Badge, Tbody, Td, Th, Thead, Tr } from "@probo/ui";
|
||||
import { graphql, useRefetchableFragment } from "react-relay";
|
||||
import { useOutletContext } from "react-router";
|
||||
|
||||
import type { RiskControlsTabControlsQuery } from "#/__generated__/core/RiskControlsTabControlsQuery.graphql";
|
||||
import type { RiskControlsTabFragment$key } from "#/__generated__/core/RiskControlsTabFragment.graphql";
|
||||
import { SortableTable, SortableTh } from "#/components/SortableTable";
|
||||
import { useOrganizationId } from "#/hooks/useOrganizationId";
|
||||
@@ -47,10 +46,8 @@ export default function RiskControlsTab() {
|
||||
risk: RiskControlsTabFragment$key & { id: string };
|
||||
}>();
|
||||
const { __ } = useTranslate();
|
||||
const [data, refetch] = useRefetchableFragment<
|
||||
RiskControlsTabControlsQuery,
|
||||
RiskControlsTabFragment$key
|
||||
>(controlsFragment, risk);
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const [data, refetch] = useRefetchableFragment(controlsFragment, risk);
|
||||
const controls = data.controls.edges.map(edge => edge.node);
|
||||
const organizationId = useOrganizationId();
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import type {
|
||||
VendorGraphPaginatedFragment$data,
|
||||
VendorGraphPaginatedFragment$key,
|
||||
} from "#/__generated__/core/VendorGraphPaginatedFragment.graphql";
|
||||
import type { VendorsListQuery } from "#/__generated__/core/VendorsListQuery.graphql";
|
||||
import { SnapshotBanner } from "#/components/SnapshotBanner";
|
||||
import { SortableTable, SortableTh } from "#/components/SortableTable";
|
||||
import {
|
||||
@@ -54,7 +53,8 @@ export default function VendorsPage(props: Props) {
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
const data = usePreloadedQuery(vendorsQuery, props.queryRef);
|
||||
const pagination = usePaginationFragment<VendorsListQuery, VendorGraphPaginatedFragment$key>(
|
||||
// eslint-disable-next-line relay/generated-typescript-types
|
||||
const pagination = usePaginationFragment(
|
||||
paginatedVendorsFragment,
|
||||
data.node as VendorGraphPaginatedFragment$key,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user