Skip to content

An eager relationship skips children relationships  #5684

@satanTime

Description

@satanTime

Issue type:

[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[x] mssql
[x] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:
If a relation is eager there's no way to fetch its children.
Please check related PR and its test.

const user = await connection.getRepository(User).findOne(userAdmin.id, {
  relations: [
    "company", // <-- eager relation.
    "company.admin", // <-- can't be loaded without the fix.
    "company.staff", // <-- can't be loaded without the fix.
    "company.staff.company", // <-- can't be loaded without the fix.
    "company.staff.company.admin", // <-- can't be loaded without the fix.
  ],
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions