_(AI generated)_ ### Summary This PR fixes a validation bug in the GraphQL API that prevented relation fields from being programmatically deactivated. The validation was incorrectly triggering a "name cannot be changed" error even when the update payload did not include a name, making it impossible to disable the field. Issue #13200 ### Problem - The [updateOneField] mutation failed when trying to set `isActive: false` on a `RELATION` field. - The root cause was a validation check in [FieldMetadataValidationService] that compared the incoming `name` with the existing one. If the input `name` was `undefined`, the check `undefined !== existingName` would incorrectly fail. - This created a catch-22 where a field could not be deleted (because it had to be deactivated first) and could not be deactivated (due to this validation error). ### Solution - The validation logic in [field-metadata-validation.service.ts] has been updated to only check for a name change if a new name is **explicitly provided** in the input (`isDefined(fieldMetadataInput.name)`). - This change correctly enforces the rule that relation field names cannot be changed, while allowing other properties like `isActive` to be updated without issue. ### How to Test 1. Create a custom field of type `RELATION`. 2. Using the GraphQL API, call the [updateOneField] mutation with the field's ID and the payload `{ "isActive": false }`. 3. Verify that the mutation succeeds and the field is now inactive. 4. Call the [deleteOneField] mutation to delete the field. 5. Verify that the deletion is successful. ### Additional Changes _to be deleted if not necessary_ - Added a new integration test [successful-field-metadata-relation-update.integration-spec.ts] to cover this specific use case and prevent future regressions. The existing test for failing updates remains untouched and continues to pass.
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See:
🚀 Self-hosting
🖥️ Local Setup
Does the world need another CRM?
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in Open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Recoil, Emotion and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!




