-
Notifications
You must be signed in to change notification settings - Fork 4.3k
[REQUIRES_CACHE_FLUSH][GQL_VIEW_GROUP_API_BREAKING_CHANGE]
ViewGroup
in v2
#15052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
[REQUIRES_CACHE_FLUSH]
ViewGroup
in v2[WHEN_RELEASED_REQUIRES_CACHE_FLUSH]
ViewGroup
in v2
[WHEN_RELEASED_REQUIRES_CACHE_FLUSH]
ViewGroup
in v2[REQUIRES_CACHE_FLUSH][GRAPH_QL_VIEW_GROUP_API_BREAKING_CHANGE]
ViewGroup
in v2
[REQUIRES_CACHE_FLUSH][GRAPH_QL_VIEW_GROUP_API_BREAKING_CHANGE]
ViewGroup
in v2[REQUIRES_CACHE_FLUSH][GQL_VIEW_GROUP_API_BREAKING_CHANGE]
ViewGroup
in v2
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:64472 This environment will automatically shut down when the PR is closed or after 5 hours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR implements ViewGroup functionality in the core engine v2, representing a significant architectural migration that introduces view grouping capabilities for organizing records by field values in different views. The implementation spans the entire Twenty stack, from backend services and database entities to frontend hooks and GraphQL operations.
Key changes include:
- Backend Infrastructure: Complete CRUD implementation for ViewGroup entities with workspace migration support, validation services, flat entity mapping, and caching mechanisms
- API Breaking Changes: Migration from v1 to v2 GraphQL API patterns where mutations now return full ViewGroup objects instead of booleans and use structured input objects instead of separate parameters
- Frontend Adaptations: Updated hooks and components to work with the new v2 API structure, maintaining optimistic updates while adapting to the new input/output patterns
- Database Integration: Enhanced view entities to include viewGroup relationships and updated all related mapping utilities to support the new entity type
The migration follows established v2 patterns with flat entity maps for performance, comprehensive validation, and feature flag support for gradual rollout. This enables users to group records within views by specific field values, enhancing data organization and visualization capabilities.
Important Files Changed
Changed Files
Filename | Score | Overview |
---|---|---|
packages/twenty-server/src/engine/metadata-modules/view-group/services/view-group-v2.service.ts | 4/5 | Major new service implementing complete CRUD operations for ViewGroup entities in v2 engine with flat entity maps and migration integration |
packages/twenty-server/src/engine/metadata-modules/view-group/resolvers/view-group.resolver.ts | 4/5 | Breaking API changes with feature flag routing between v1/v2 services and modified mutation signatures using input DTOs |
packages/twenty-front/src/generated/graphql.ts | 4/5 | Extensive GraphQL schema changes with breaking API modifications for ViewGroup operations and enhanced type definitions |
packages/twenty-front/src/modules/views/hooks/internal/usePersistViewGroupRecords.ts | 4/5 | Refactored to use v2 GraphQL APIs with generated hooks replacing manual Apollo Client mutations |
packages/twenty-server/src/engine/workspace-manager/workspace-migration-v2/services/workspace-migration-build-orchestrator.service.ts | 5/5 | Added ViewGroup support to workspace migration orchestrator following established patterns for other entities |
packages/twenty-server/src/engine/metadata-modules/view-group/dtos/inputs/update-view-group.input.ts | 5/5 | Complete refactor to structured two-class approach with explicit validation and GraphQL schema definitions |
packages/twenty-front/src/modules/views/hooks/useSaveCurrentViewGroups.ts | 5/5 | Updated data structure for view group operations to use input/update pattern for API consistency |
packages/twenty-server/src/engine/metadata-modules/flat-view-group/services/workspace-flat-view-group-map-cache.service.ts | 5/5 | New cache service implementing workspace-scoped caching for view group metadata following established patterns |
packages/twenty-server/test/integration/metadata/suites/view-group/utils/create-core-view-group-query-factory.util.ts | 5/5 | New GraphQL mutation factory for testing ViewGroup creation in v2 architecture |
packages/twenty-server/src/engine/metadata-modules/view-group/entities/view-group.entity.ts | 5/5 | Modified deletedAt field from optional to required property for v2 engine consistency |
Confidence score: 4/5
- This PR introduces complex architectural changes but follows established v2 patterns throughout the codebase
- Score reflects the comprehensive nature of changes across multiple layers requiring careful coordination during deployment
- Pay close attention to migration orchestrator service, view group v2 service, and GraphQL schema changes as they form the core of the new functionality
Additional Comments (1)
-
packages/twenty-front/src/modules/object-record/record-index/hooks/useHandleRecordGroupField.ts
, line 150 (link)logic: Missing
await
for async call to getViewFromPrefetchState
75 files reviewed, 11 comments
packages/twenty-front/src/modules/views/graphql/mutations/updateCoreViewGroup.ts
Show resolved
Hide resolved
...n-v2/workspace-migration-builder-v2/validators/services/flat-view-group-validator.service.ts
Outdated
Show resolved
Hide resolved
...on-runner-v2/action-handlers/view-group/services/update-view-group-action-handler.service.ts
Outdated
Show resolved
Hide resolved
...-server/test/integration/metadata/suites/view-group/utils/update-one-core-view-group.util.ts
Show resolved
Hide resolved
...twenty-server/src/engine/metadata-modules/view-group/dtos/inputs/destroy-view-group.input.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/metadata-modules/view-group/services/view-group-v2.service.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/metadata-modules/view-group/resolvers/view-group.resolver.ts
Show resolved
Hide resolved
...-view-group/utils/from-update-view-group-input-to-flat-view-group-to-update-or-throw.util.ts
Show resolved
Hide resolved
...ules/flat-view-group/utils/from-create-view-group-input-to-flat-view-group-to-create.util.ts
Show resolved
Hide resolved
...ules/flat-view-group/utils/from-create-view-group-input-to-flat-view-group-to-create.util.ts
Show resolved
Hide resolved
📊 API Changes ReportGraphQL Schema ChangesGraphQL Schema Changes[log] [log] ✖ Field Mutation.deleteCoreViewGroup changed type from Boolean! to CoreViewGroup!
GraphQL Metadata Schema ChangesGraphQL Metadata Schema Changes[log] [log] ✖ Field Mutation.deleteCoreViewGroup changed type from Boolean! to CoreViewGroup!
✅ Breaking Change ProtocolThis PR title contains "breaking" and breaking changes were detected - the CI will fail as expected. 📝 Action Required: Please add Example:
|
Introduction
Adding view-group to core engine v2
close twentyhq/core-team-issues#1665