Add useUpdateManyRecords hook and message folders sync status mutation (#16694)

- Added new `useUpdateManyRecords` hook for batch record updates with
optimistic cache updates
- Added `updateMessageFoldersSyncStatus` hook for managing message
folder sync state
- Redesigned Message Folders List with BreadCrumb and Animations
This commit is contained in:
neo773
2025-12-19 21:52:59 +05:30
committed by GitHub
parent a19b9e1cb8
commit 024ee152a0
20 changed files with 1490 additions and 222 deletions
@@ -0,0 +1,29 @@
import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import { getUpdateManyRecordsMutationResponseField } from '@/object-record/utils/getUpdateManyRecordsMutationResponseField';
import { gql } from '@apollo/client';
import { capitalize } from 'twenty-shared/utils';
export const generateUpdateManyRecordsMutation = ({
objectMetadataItem,
}: {
objectMetadataItem: ObjectMetadataItem;
}) => {
const capitalizedObjectNameSingular = capitalize(
objectMetadataItem.nameSingular,
);
const capitalizedObjectNamePlural = capitalize(objectMetadataItem.namePlural);
const mutationResponseField = getUpdateManyRecordsMutationResponseField(
objectMetadataItem.namePlural,
);
const updateManyRecordsMutation = gql`
mutation UpdateMany${capitalizedObjectNamePlural}($filter: ${capitalizedObjectNameSingular}FilterInput!, $data: ${capitalizedObjectNameSingular}UpdateInput!) {
${mutationResponseField}(filter: $filter, data: $data) {
id
}
}
`;
return updateManyRecordsMutation;
};