[REQUIRES_CACHE_FLUSH][GQL_VIEW_GROUP_API_BREAKING_CHANGE] ViewGroup in v2 (#15052)

# Introduction
Adding view-group to core engine v2
Following https://github.com/twentyhq/twenty/pull/15010 ( same pattern )

## What's done
- Created flat-view-group
- flat view group runner
- flat view group builder
- create view group service v2 and input transpilers
- refactor the existing view group resolver to fix standard (
BREAKING_CHANGE on graphql api update especially ) REST stays the same
- refactored the front to consume the mutations autogenerated

close https://github.com/twentyhq/core-team-issues/issues/1665
This commit is contained in:
Paul Rastoin
2025-10-14 15:55:50 +02:00
committed by GitHub
parent 5fec6a9afc
commit 7d747c9876
88 changed files with 2640 additions and 497 deletions
@@ -63,7 +63,17 @@ export const useSaveCurrentViewGroups = () => {
}
await updateViewGroupRecords([
{ ...viewGroupToSave, id: existingField.id },
{
input: {
id: existingField.id,
update: {
isVisible: viewGroupToSave.isVisible,
position: viewGroupToSave.position,
fieldMetadataId: viewGroupToSave.fieldMetadataId,
fieldValue: viewGroupToSave.fieldValue,
},
},
},
]);
},
[
@@ -118,7 +128,17 @@ export const useSaveCurrentViewGroups = () => {
return undefined;
}
return { ...viewGroupToSave, id: existingField.id };
return {
input: {
id: existingField.id,
update: {
isVisible: viewGroupToSave.isVisible,
position: viewGroupToSave.position,
fieldMetadataId: viewGroupToSave.fieldMetadataId,
fieldValue: viewGroupToSave.fieldValue,
},
},
};
})
.filter(isDefined);
@@ -131,7 +151,14 @@ export const useSaveCurrentViewGroups = () => {
);
await Promise.all([
createViewGroupRecords({ viewGroupsToCreate, viewId: view.id }),
createViewGroupRecords(
viewGroupsToCreate.map((viewGroup) => ({
input: {
...viewGroup,
viewId: view.id,
},
})),
),
updateViewGroupRecords(viewGroupsToUpdate),
]);
},