From 7e7784f4445541c0fc107113fbcb3d195a511ad2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Bosi?=
<71827178+bosiraphael@users.noreply.github.com>
Date: Fri, 11 Oct 2024 18:08:12 +0200
Subject: [PATCH 01/27] Fix icon button disabled border (#7607)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/ui/input/button/components/IconButton.tsx | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/packages/twenty-front/src/modules/ui/input/button/components/IconButton.tsx b/packages/twenty-front/src/modules/ui/input/button/components/IconButton.tsx
index e5e83551cdcc..dae5a8f1bc52 100644
--- a/packages/twenty-front/src/modules/ui/input/button/components/IconButton.tsx
+++ b/packages/twenty-front/src/modules/ui/input/button/components/IconButton.tsx
@@ -33,11 +33,9 @@ const StyledButton = styled.button<
case 'default':
return css`
background: ${theme.background.secondary};
- border-color: ${!disabled
- ? focus
- ? theme.color.blue
- : theme.background.transparent.light
- : 'transparent'};
+ border-color: ${focus
+ ? theme.color.blue
+ : theme.background.transparent.light};
border-width: ${!disabled && focus ? '1px 1px !important' : 0};
box-shadow: ${!disabled && focus
? `0 0 0 3px ${theme.accent.tertiary}`
From d350143c9204037596d4202f2917f167202193e1 Mon Sep 17 00:00:00 2001
From: nitin <142569587+ehconitin@users.noreply.github.com>
Date: Fri, 11 Oct 2024 22:37:56 +0530
Subject: [PATCH 02/27] Fix field forms (#7595)
@lucasbordeau
forms are broken!
revert - #7363
used useRelationSettingsFormInitialValues hook from that commit.
TODO - figure out a way to change the relation name label from singular
to plural and vice versa, until it is edited.
related issue - #7355
---------
Co-authored-by: Lucas Bordeau
---
.../SettingsDataModelFieldIconLabelForm.tsx | 38 +------------------
.../SettingsDataModelFieldRelationForm.tsx | 33 +++-------------
...DataModelFieldRelationSettingsFormCard.tsx | 5 ++-
3 files changed, 10 insertions(+), 66 deletions(-)
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx
index 3e6b3213614e..d4771446e5d3 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx
@@ -3,14 +3,10 @@ import { Controller, useFormContext } from 'react-hook-form';
import { z } from 'zod';
import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
-import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { fieldMetadataItemSchema } from '@/object-metadata/validation-schemas/fieldMetadataItemSchema';
import { getErrorMessageFromError } from '@/settings/data-model/fields/forms/utils/errorMessages';
-import { RelationType } from '@/settings/data-model/types/RelationType';
import { IconPicker } from '@/ui/input/components/IconPicker';
import { TextInput } from '@/ui/input/components/TextInput';
-import { useEffect, useState } from 'react';
-import { RelationDefinitionType } from '~/generated-metadata/graphql';
export const settingsDataModelFieldIconLabelFormSchema = (
existingOtherLabels: string[] = [],
@@ -36,47 +32,19 @@ type SettingsDataModelFieldIconLabelFormProps = {
disabled?: boolean;
fieldMetadataItem?: FieldMetadataItem;
maxLength?: number;
- relationObjectMetadataItem?: ObjectMetadataItem;
- relationType?: RelationType;
};
export const SettingsDataModelFieldIconLabelForm = ({
disabled,
fieldMetadataItem,
maxLength,
- relationObjectMetadataItem,
- relationType,
}: SettingsDataModelFieldIconLabelFormProps) => {
const {
control,
trigger,
formState: { errors },
- setValue,
} = useFormContext();
- const [labelEditedManually, setLabelEditedManually] = useState(false);
- const [iconEditedManually, setIconEditedManually] = useState(false);
-
- useEffect(() => {
- if (labelEditedManually || !relationType) return;
- const label = [
- RelationDefinitionType.ManyToOne,
- RelationDefinitionType.ManyToMany,
- ].includes(relationType ?? RelationDefinitionType.OneToMany)
- ? relationObjectMetadataItem?.labelPlural
- : relationObjectMetadataItem?.labelSingular;
- setValue('label', label ?? '');
-
- if (iconEditedManually) return;
- setValue('icon', relationObjectMetadataItem?.icon ?? 'IconUsers');
- }, [
- labelEditedManually,
- iconEditedManually,
- relationObjectMetadataItem,
- setValue,
- relationType,
- ]);
-
return (
{
- setIconEditedManually(true);
- onChange(iconKey);
- }}
+ onChange={({ iconKey }) => onChange(iconKey)}
variant="primary"
/>
)}
@@ -104,7 +69,6 @@ export const SettingsDataModelFieldIconLabelForm = ({
placeholder="Employees"
value={value}
onChange={(e) => {
- setLabelEditedManually(true);
onChange(e);
trigger('label');
}}
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationForm.tsx
index 9b0968c4f180..854b59b68154 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationForm.tsx
@@ -5,18 +5,17 @@ import { z } from 'zod';
import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';
import { FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
+import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { isObjectMetadataAvailableForRelation } from '@/object-metadata/utils/isObjectMetadataAvailableForRelation';
import { fieldMetadataItemSchema } from '@/object-metadata/validation-schemas/fieldMetadataItemSchema';
import { FIELD_NAME_MAXIMUM_LENGTH } from '@/settings/data-model/constants/FieldNameMaximumLength';
import { RELATION_TYPES } from '@/settings/data-model/constants/RelationTypes';
import { useRelationSettingsFormInitialValues } from '@/settings/data-model/fields/forms/relation/hooks/useRelationSettingsFormInitialValues';
-import { SettingsDataModelFieldPreviewCardProps } from '@/settings/data-model/fields/preview/components/SettingsDataModelFieldPreviewCard';
import { RelationType } from '@/settings/data-model/types/RelationType';
import { IconPicker } from '@/ui/input/components/IconPicker';
import { Select } from '@/ui/input/components/Select';
import { TextInput } from '@/ui/input/components/TextInput';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
-import { useEffect, useState } from 'react';
import { RelationDefinitionType } from '~/generated-metadata/graphql';
export const settingsDataModelFieldRelationFormSchema = z.object({
@@ -41,7 +40,7 @@ export type SettingsDataModelFieldRelationFormValues = z.infer<
type SettingsDataModelFieldRelationFormProps = {
fieldMetadataItem: Pick;
- objectMetadataItem: SettingsDataModelFieldPreviewCardProps['objectMetadataItem'];
+ objectMetadataItem: ObjectMetadataItem;
};
const StyledContainer = styled.div`
@@ -84,17 +83,12 @@ export const SettingsDataModelFieldRelationForm = ({
fieldMetadataItem,
objectMetadataItem,
}: SettingsDataModelFieldRelationFormProps) => {
- const {
- control,
- watch: watchFormValue,
- setValue,
- } = useFormContext();
+ const { control, watch: watchFormValue } =
+ useFormContext();
const { getIcon } = useIcons();
const { objectMetadataItems, findObjectMetadataItemById } =
useFilteredObjectMetadataItems();
- const [labelEditedManually, setLabelEditedManually] = useState(false);
-
const {
disableFieldEdition,
disableRelationEdition,
@@ -111,20 +105,6 @@ export const SettingsDataModelFieldRelationForm = ({
);
const isMobile = useIsMobile();
- const relationType = watchFormValue('relation.type');
-
- useEffect(() => {
- if (labelEditedManually) return;
- setValue(
- 'relation.field.label',
- [
- RelationDefinitionType.ManyToMany,
- RelationDefinitionType.ManyToOne,
- ].includes(relationType)
- ? objectMetadataItem.labelPlural
- : objectMetadataItem.labelSingular,
- );
- }, [labelEditedManually, objectMetadataItem, relationType, setValue]);
return (
@@ -195,10 +175,7 @@ export const SettingsDataModelFieldRelationForm = ({
disabled={disableFieldEdition}
placeholder="Field name"
value={value}
- onChange={(newValue) => {
- setLabelEditedManually(true);
- onChange(newValue);
- }}
+ onChange={onChange}
fullWidth
maxLength={FIELD_NAME_MAXIMUM_LENGTH}
/>
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationSettingsFormCard.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationSettingsFormCard.tsx
index 33509e08e632..0372ba071417 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationSettingsFormCard.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/relation/components/SettingsDataModelFieldRelationSettingsFormCard.tsx
@@ -60,7 +60,10 @@ export const SettingsDataModelFieldRelationSettingsFormCard = ({
initialRelationObjectMetadataItem,
initialRelationType,
initialRelationFieldMetadataItem,
- } = useRelationSettingsFormInitialValues({ fieldMetadataItem });
+ } = useRelationSettingsFormInitialValues({
+ fieldMetadataItem,
+ objectMetadataItem,
+ });
const relationObjectMetadataId = watchFormValue(
'relation.objectMetadataId',
From 7b96be6f8c02c84b9e8f1a15554ee4e78b8514b0 Mon Sep 17 00:00:00 2001
From: Charles Bochet
Date: Fri, 11 Oct 2024 20:23:01 +0200
Subject: [PATCH 03/27] Fix optimistic effect deletedAt (#7606)
In this PR, I'm fixing part of the impact of soft deletion on optimistic
rendering.
## Backend Vision
1) Backend endpoints will not return soft deleted records (having
deletedAt set) by default. To get the softDeleted records, we will pass
a { withSoftDelete: true } additional param in the query.
2) Record relations will NEVER contain softDeleted relations
## Backend current state
Right now, we have the following behavior:
- if the query filters do not mention deletedAt, we don't return
softDeletedRecords
- if the query filters mention deletedAt, we take it into consideration.
Meaning that if we want to have the softDeleted records in any way we
need to do { or: [ deletedAt: NULL, deletedAt: NOT_NULL] }
## Optimistic rendering strategy
1) useDestroyOne/Many is triggering destroyOptimisticEffects (previously
deleteOptimisticEffects)
2) UseDeleteOne/Many and useRestoreOne/Many are actually triggering
updateOptimisticEffects (as they only update deletedAt field) AND we
need updateOptimisticEffects to take into account deletedAt (future
withSoftDelete: true) filter.
---
... triggerDestroyRecordsOptimisticEffect.ts} | 19 +--
.../triggerUpdateRecordOptimisticEffect.ts | 73 ++++-----
.../triggerUpdateRelationsOptimisticEffect.ts | 6 +-
.../cache/hooks/useDeleteRecordFromCache.ts | 4 +-
.../cache/utils/deleteRecordFromCache.ts | 12 +-
.../__tests__/useDeleteManyRecords.test.tsx | 7 +-
.../hooks/useCreateManyRecords.ts | 10 +-
.../object-record/hooks/useCreateOneRecord.ts | 8 +-
.../hooks/useDeleteManyRecords.ts | 146 ++++++++++++------
.../object-record/hooks/useDeleteOneRecord.ts | 87 +++++++----
.../hooks/useDestroyManyRecords.ts | 22 +--
.../hooks/useDestroyOneRecord.ts | 6 +-
.../hooks/useRestoreManyRecords.ts | 136 +++++++++++++---
.../utils/isRecordMatchingFilter.ts | 15 +-
.../options/hooks/useDeleteTableData.ts | 33 +---
.../components/ShowPageMoreButton.tsx | 6 +-
.../internal/usePersistViewFilterRecords.ts | 20 +--
.../internal/usePersistViewSortRecords.ts | 20 +--
.../graphql-query-filter-field.parser.ts | 24 +--
...phql-query-destroy-one-resolver.service.ts | 2 +-
...phql-query-update-many-resolver.service.ts | 8 +-
21 files changed, 407 insertions(+), 257 deletions(-)
rename packages/twenty-front/src/modules/apollo/optimistic-effect/utils/{triggerDeleteRecordsOptimisticEffect.ts => triggerDestroyRecordsOptimisticEffect.ts} (85%)
diff --git a/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerDeleteRecordsOptimisticEffect.ts b/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerDestroyRecordsOptimisticEffect.ts
similarity index 85%
rename from packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerDeleteRecordsOptimisticEffect.ts
rename to packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerDestroyRecordsOptimisticEffect.ts
index 80c880094a54..5f62ff3bdbf3 100644
--- a/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerDeleteRecordsOptimisticEffect.ts
+++ b/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerDestroyRecordsOptimisticEffect.ts
@@ -7,15 +7,15 @@ import { isObjectRecordConnectionWithRefs } from '@/object-record/cache/utils/is
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
import { isDefined } from '~/utils/isDefined';
-export const triggerDeleteRecordsOptimisticEffect = ({
+export const triggerDestroyRecordsOptimisticEffect = ({
cache,
objectMetadataItem,
- recordsToDelete,
+ recordsToDestroy,
objectMetadataItems,
}: {
cache: ApolloCache;
objectMetadataItem: ObjectMetadataItem;
- recordsToDelete: RecordGqlNode[];
+ recordsToDestroy: RecordGqlNode[];
objectMetadataItems: ObjectMetadataItem[];
}) => {
cache.modify({
@@ -36,7 +36,7 @@ export const triggerDeleteRecordsOptimisticEffect = ({
const rootQueryCachedObjectRecordConnection = rootQueryCachedResponse;
- const recordIdsToDelete = recordsToDelete.map(({ id }) => id);
+ const recordIdsToDelete = recordsToDestroy.map(({ id }) => id);
const cachedEdges = readField(
'edges',
@@ -69,20 +69,15 @@ export const triggerDeleteRecordsOptimisticEffect = ({
},
});
- recordsToDelete.forEach((recordToDelete) => {
+ recordsToDestroy.forEach((recordToDestroy) => {
triggerUpdateRelationsOptimisticEffect({
cache,
sourceObjectMetadataItem: objectMetadataItem,
- currentSourceRecord: recordToDelete,
+ currentSourceRecord: recordToDestroy,
updatedSourceRecord: null,
objectMetadataItems,
});
- cache.modify({
- id: cache.identify(recordToDelete),
- fields: {
- deletedAt: () => recordToDelete.deletedAt,
- },
- });
+ cache.evict({ id: cache.identify(recordToDestroy) });
});
};
diff --git a/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerUpdateRecordOptimisticEffect.ts b/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerUpdateRecordOptimisticEffect.ts
index 3c09c213f68b..15878796f5bd 100644
--- a/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerUpdateRecordOptimisticEffect.ts
+++ b/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerUpdateRecordOptimisticEffect.ts
@@ -65,50 +65,45 @@ export const triggerUpdateRecordOptimisticEffect = ({
const rootQueryFilter = rootQueryVariables?.filter;
const rootQueryOrderBy = rootQueryVariables?.orderBy;
- const shouldTryToMatchFilter = isDefined(rootQueryFilter);
-
- if (shouldTryToMatchFilter) {
- const updatedRecordMatchesThisRootQueryFilter =
- isRecordMatchingFilter({
- record: updatedRecord,
- filter: rootQueryFilter,
- objectMetadataItem,
- });
+ const updatedRecordMatchesThisRootQueryFilter = isRecordMatchingFilter({
+ record: updatedRecord,
+ filter: rootQueryFilter ?? {},
+ objectMetadataItem,
+ });
+
+ const updatedRecordIndexInRootQueryEdges =
+ rootQueryCurrentEdges.findIndex(
+ (cachedEdge) =>
+ readField('id', cachedEdge.node) === updatedRecord.id,
+ );
- const updatedRecordIndexInRootQueryEdges =
- rootQueryCurrentEdges.findIndex(
- (cachedEdge) =>
- readField('id', cachedEdge.node) === updatedRecord.id,
- );
-
- const updatedRecordFoundInRootQueryEdges =
- updatedRecordIndexInRootQueryEdges > -1;
-
- const updatedRecordShouldBeAddedToRootQueryEdges =
- updatedRecordMatchesThisRootQueryFilter &&
- !updatedRecordFoundInRootQueryEdges;
-
- const updatedRecordShouldBeRemovedFromRootQueryEdges =
- !updatedRecordMatchesThisRootQueryFilter &&
- updatedRecordFoundInRootQueryEdges;
-
- if (updatedRecordShouldBeAddedToRootQueryEdges) {
- const updatedRecordNodeReference = toReference(updatedRecord);
-
- if (isDefined(updatedRecordNodeReference)) {
- rootQueryNextEdges.push({
- __typename: getEdgeTypename(objectMetadataItem.nameSingular),
- node: updatedRecordNodeReference,
- cursor: '',
- });
- }
- }
+ const updatedRecordFoundInRootQueryEdges =
+ updatedRecordIndexInRootQueryEdges > -1;
+
+ const updatedRecordShouldBeAddedToRootQueryEdges =
+ updatedRecordMatchesThisRootQueryFilter &&
+ !updatedRecordFoundInRootQueryEdges;
+
+ const updatedRecordShouldBeRemovedFromRootQueryEdges =
+ !updatedRecordMatchesThisRootQueryFilter &&
+ updatedRecordFoundInRootQueryEdges;
- if (updatedRecordShouldBeRemovedFromRootQueryEdges) {
- rootQueryNextEdges.splice(updatedRecordIndexInRootQueryEdges, 1);
+ if (updatedRecordShouldBeAddedToRootQueryEdges) {
+ const updatedRecordNodeReference = toReference(updatedRecord);
+
+ if (isDefined(updatedRecordNodeReference)) {
+ rootQueryNextEdges.push({
+ __typename: getEdgeTypename(objectMetadataItem.nameSingular),
+ node: updatedRecordNodeReference,
+ cursor: '',
+ });
}
}
+ if (updatedRecordShouldBeRemovedFromRootQueryEdges) {
+ rootQueryNextEdges.splice(updatedRecordIndexInRootQueryEdges, 1);
+ }
+
const rootQueryNextEdgesShouldBeSorted = isDefined(rootQueryOrderBy);
if (
diff --git a/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerUpdateRelationsOptimisticEffect.ts b/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerUpdateRelationsOptimisticEffect.ts
index 535f33db4f8a..4e44e098adcb 100644
--- a/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerUpdateRelationsOptimisticEffect.ts
+++ b/packages/twenty-front/src/modules/apollo/optimistic-effect/utils/triggerUpdateRelationsOptimisticEffect.ts
@@ -1,7 +1,7 @@
import { ApolloCache } from '@apollo/client';
import { triggerAttachRelationOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerAttachRelationOptimisticEffect';
-import { triggerDeleteRecordsOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerDeleteRecordsOptimisticEffect';
+import { triggerDestroyRecordsOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerDestroyRecordsOptimisticEffect';
import { triggerDetachRelationOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerDetachRelationOptimisticEffect';
import { CORE_OBJECT_NAMES_TO_DELETE_ON_TRIGGER_RELATION_DETACH } from '@/apollo/types/coreObjectNamesToDeleteOnRelationDetach';
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
@@ -122,10 +122,10 @@ export const triggerUpdateRelationsOptimisticEffect = ({
);
if (shouldCascadeDeleteTargetRecords) {
- triggerDeleteRecordsOptimisticEffect({
+ triggerDestroyRecordsOptimisticEffect({
cache,
objectMetadataItem: fullTargetObjectMetadataItem,
- recordsToDelete: targetRecordsToDetachFrom,
+ recordsToDestroy: targetRecordsToDetachFrom,
objectMetadataItems,
});
} else {
diff --git a/packages/twenty-front/src/modules/object-record/cache/hooks/useDeleteRecordFromCache.ts b/packages/twenty-front/src/modules/object-record/cache/hooks/useDeleteRecordFromCache.ts
index 693236975e51..90105c700526 100644
--- a/packages/twenty-front/src/modules/object-record/cache/hooks/useDeleteRecordFromCache.ts
+++ b/packages/twenty-front/src/modules/object-record/cache/hooks/useDeleteRecordFromCache.ts
@@ -18,11 +18,11 @@ export const useDeleteRecordFromCache = ({
const { objectMetadataItems } = useObjectMetadataItems();
- return (recordToDelete: ObjectRecord) => {
+ return (recordToDestroy: ObjectRecord) => {
deleteRecordFromCache({
objectMetadataItem,
objectMetadataItems,
- recordToDelete,
+ recordToDestroy,
cache: apolloClient.cache,
});
};
diff --git a/packages/twenty-front/src/modules/object-record/cache/utils/deleteRecordFromCache.ts b/packages/twenty-front/src/modules/object-record/cache/utils/deleteRecordFromCache.ts
index ec9ec8b3a4a3..10bc657ca3d7 100644
--- a/packages/twenty-front/src/modules/object-record/cache/utils/deleteRecordFromCache.ts
+++ b/packages/twenty-front/src/modules/object-record/cache/utils/deleteRecordFromCache.ts
@@ -1,6 +1,6 @@
import { ApolloCache } from '@apollo/client';
-import { triggerDeleteRecordsOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerDeleteRecordsOptimisticEffect';
+import { triggerDestroyRecordsOptimisticEffect } from '@/apollo/optimistic-effect/utils/triggerDestroyRecordsOptimisticEffect';
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { getObjectTypename } from '@/object-record/cache/utils/getObjectTypename';
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
@@ -8,21 +8,21 @@ import { ObjectRecord } from '@/object-record/types/ObjectRecord';
export const deleteRecordFromCache = ({
objectMetadataItem,
objectMetadataItems,
- recordToDelete,
+ recordToDestroy,
cache,
}: {
objectMetadataItem: ObjectMetadataItem;
objectMetadataItems: ObjectMetadataItem[];
- recordToDelete: ObjectRecord;
+ recordToDestroy: ObjectRecord;
cache: ApolloCache