Files
twenty/packages/twenty-server/test/integration/graphql/suites/query-complexity/constants/tooManyRelationQueryGqlFields.constant.ts
T
Abdullah.andGitHub 7867617385 Migrate noteTarget and taskTarget to Morph. (#17476)
This PR migrates `noteTarget` and `taskTarget` to morph relations behind
separate feature flags, following the Attachment/TimelineActivity
pattern.

It introduces the `IS_NOTE_TARGET_MIGRATED` and
`IS_TASK_TARGET_MIGRATED` flags, updates standard field metadata and
indexes to use morph relations, and adds two **1.17 workspace
migrations** that:
- rename `noteTarget.*Id` / `taskTarget.*Id` columns to `target*Id`
- convert the corresponding field metadata to `MORPH_RELATION` with a
shared `morphId`

On the frontend, note/task target read and write paths switch to
`target*Id` when the respective flag is enabled. Deleted targets are
filtered on reload to prevent reappearing relations.
2026-02-04 02:53:06 +00:00

95 lines
1.4 KiB
TypeScript

export const TOO_MANY_RELATION_QUERY_GQL_FIELDS = `
id
city
jobTitle
avatarUrl
intro
searchVector
pointOfContactForOpportunities {
edges {
node {
id
company {
id
}
}
}
}
favorites {
edges {
node {
id
company {
id
}
person {
id
company {
id
}
}
}
}
}
noteTargets {
edges {
node {
id
targetCompany {
id
}
note {
id
}
targetPerson {
id
company {
id
}
}
targetCompany {
id
}
targetOpportunity {
id
}
}
}
}
taskTargets {
edges {
node {
id
targetCompany {
id
}
targetPerson {
id
company {
id
}
}
targetCompany {
id
}
targetOpportunity {
id
}
}
}
}
company {
id
people {
edges {
node {
id
company {
id
}
}
}
}
}
`;