INNER CODE UNIT · TypeScript

handleOneToOneNotOwnerWithSelfKey

slaypni/type-graphql-dataloader · src/decorators/typeorm/ExplicitLoaderImpl.ts:140

async function handleOneToOneNotOwnerWithSelfKey<V>(
  selfKeyFunc: (root: any) => any | undefined,
  root: any,
  tgdContext: TgdContext,
  relation: RelationMetadata
) {
  return handler(
    tgdContext,
    relation,
    relation.entityMetadata.primaryColumns,
    (connection) => new SelfKeyDataloader<V>(relation, connection, selfKeyFunc),
    async (dataloader, columns) => {
      const pk = columns[0].getEntityValue(root);
      return (await dataloader.load(pk))[0] ?? null;
    }
  );
}
function directLoader<V>(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…