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:
+1
-1
@@ -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;
|
||||
|
||||
+2
-2
@@ -71,14 +71,14 @@ export const mapObjectMetadataToGraphQLQuery = ({
|
||||
}
|
||||
|
||||
return fieldMetadata.morphRelations.map((morphRelation) => ({
|
||||
gqlField: computeMorphRelationFieldName({
|
||||
gqlField: `${computeMorphRelationFieldName({
|
||||
fieldName: fieldMetadata.name,
|
||||
relationType: morphRelation.type,
|
||||
targetObjectMetadataNameSingular:
|
||||
morphRelation.targetObjectMetadata.nameSingular,
|
||||
targetObjectMetadataNamePlural:
|
||||
morphRelation.targetObjectMetadata.namePlural,
|
||||
}),
|
||||
})}Id`,
|
||||
fieldMetadata: fieldMetadata,
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user