Add activityTarget relation after custom object creation (#2670)

* Add activityTarget relation after custom object creation

* add isCustom check for relations
This commit is contained in:
Weiko
2023-11-23 16:26:33 +01:00
committed by GitHub
parent 4b42ed42dc
commit c795db33b2
5 changed files with 126 additions and 3 deletions

View File

@ -95,7 +95,7 @@ export class CompositeFieldAliasFactory {
}
`;
}
let relationAlias = fieldKey;
let relationAlias = fieldMetadata.isCustom ? `_${fieldKey}` : fieldKey;
// For one to one relations, pg_graphql use the targetTableName on the side that is not storing the foreign key
// so we need to alias it to the field key

View File

@ -18,4 +18,5 @@ export interface FieldMetadataInterface<
isNullable?: boolean;
fromRelationMetadata?: RelationMetadataEntity;
toRelationMetadata?: RelationMetadataEntity;
isCustom?: boolean;
}