Files
twenty/packages/twenty-server/test/integration/constants/view-gql-fields.constants.ts
T
Marie 7ce22d5c7e breaking (soft) - Migrate viewGroup.fieldMetadataId -> view.mainGroupByFieldMetadataId (2/3) (#16277)
Should be merged once https://github.com/twentyhq/twenty/pull/16206 has
been released + command run to prod

In this PR
- Remove usage of viewGroup.fieldMetadataId, both in BE and FE states. 
- But we still need to properly populate it until we fully remove
viewGroup.fieldMetadataId from db and ORM entity (upcoming 3rd PR out of
3). fieldMetadataId was removed from CoreViewGroup type and
CreateViewGroupInput and is determined BE-side based on the associated
view's mainGroupByFieldMetadataId. **I expect this means a downtime on
viewGroup creation, until both FE and BE are deployed and cache is
flushed.** This seems acceptable to me as it only regards viewGroup
creation.
    - this information is replaced by view.mainGroupByFieldMetadataID
- Handle view group creation, update and deletion in the BE as a
side-effect of a view creation, update or deletion. Optimistic effects
are still used
- Add validation at view creation or update regarding
mainGroupByFieldMetadata

Left to do in 3rd PR
- Remove viewGroup.fieldMetadataId from db and ORM entity
- Restore feature allowing to update an existing grouped view's group by
field (already OK on BE side but need to rebuild FE optimistic)
2025-12-05 14:00:03 +00:00

72 lines
1000 B
TypeScript

export const VIEW_GQL_FIELDS = `
id
name
objectMetadataId
type
key
mainGroupByFieldMetadataId
icon
position
isCompact
openRecordIn
workspaceId
anyFieldFilterValue
createdAt
updatedAt
deletedAt
`;
export const VIEW_FIELD_GQL_FIELDS = `
id
fieldMetadataId
position
isVisible
size
viewId
createdAt
updatedAt
deletedAt
`;
export const VIEW_SORT_GQL_FIELDS = `
id
fieldMetadataId
direction
viewId
createdAt
updatedAt
deletedAt
`;
export const VIEW_FILTER_GQL_FIELDS = `
id
fieldMetadataId
operand
value
viewId
createdAt
updatedAt
deletedAt
`;
export const VIEW_GROUP_GQL_FIELDS = `
id
fieldValue
isVisible
position
viewId
createdAt
updatedAt
deletedAt
`;
export const VIEW_FILTER_GROUP_GQL_FIELDS = `
id
logicalOperator
parentViewFilterGroupId
viewId
createdAt
updatedAt
deletedAt
`;