Optimistic rendering of morph relations (#14997)

The optimistic rendering of a morph relation Is broken. We intend to fix
it here.

- mapping of gql fields


Fixes https://github.com/twentyhq/core-team-issues/issues/1322

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Guillim
2025-10-10 19:11:00 +02:00
committed by GitHub
parent 00eef8ba33
commit 448091e81f
9 changed files with 814 additions and 198 deletions
@@ -107,7 +107,7 @@ export const mapFieldMetadataToGraphQLQuery = ({
}
if (fieldMetadata.settings?.relationType === RelationType.MANY_TO_ONE) {
if (gqlField === fieldMetadata.settings?.joinColumnName) {
if (gqlField === `${relationFieldName}Id`) {
gqlMorphField += `${gqlField}
`;
continue;