mergePeople mutation fails with "A duplicate entry was detected" on execution even though dryRun succeeds
Summary
Calling the mergePeople GraphQL mutation with dryRun: true succeeds cleanly and returns a valid (mock) result, with no changes made to the source records (verified via REST). Calling the exact same mutation with dryRun: false on the exact same input consistently fails with:
{"errors": [{"message": "A duplicate entry was detected", "extensions": {"userFriendlyMessage": "This record already exists. Please check your data and try again.", "code": "BAD_USER_INPUT"}}]}
Reproduced on 11 distinct Person groups (2-4 members each), 100% reproducible, not transient. Tried:
- Swapping conflictPriorityIndex (0 vs 1, i.e. which record is kept as primary) - same error either way.
- Checked for a hidden third record that could collide on name/email uniqueness criteria - none found for at least one tested group.
Minimal repro: two Person records flagged as duplicates by a dedup scan, merged via: mutation Merge($ids: [UUID!]!) { mergePeople(ids: $ids, conflictPriorityIndex: 0, dryRun: false) { id } } with $ids = [primaryId, otherId]. dryRun: true on the same variables succeeds.
Expected: the real merge should succeed the same way the dry run validates it will, or return a more specific error indicating which field/constraint actually collides.
This feature idea was drafted with AI assistance as part of an internal improvement-tracking workflow. It is a suggestion only — no code changes are proposed or included.
Source: twentyhq/twenty