Improve perf during repository creation in nested relations (#7132)

This commit is contained in:
Weiko
2024-09-18 21:54:22 +02:00
committed by GitHub
parent 210c336ccf
commit ad18c44f25
3 changed files with 21 additions and 40 deletions

View File

@ -48,11 +48,14 @@ export class GraphqlQueryFindManyResolverService {
this.validateArgsOrThrow(args);
const repository =
await this.twentyORMGlobalManager.getRepositoryForWorkspace(
const dataSource =
await this.twentyORMGlobalManager.getDataSourceForWorkspace(
authContext.workspace.id,
objectMetadataItem.nameSingular,
);
const repository = dataSource.getRepository(
objectMetadataItem.nameSingular,
);
const objectMetadataMap = generateObjectMetadataMap(
objectMetadataCollection,
);
@ -125,6 +128,7 @@ export class GraphqlQueryFindManyResolverService {
relations,
limit,
authContext,
dataSource,
);
}