We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Crud({ model: { type: Gate, }, }) @ApiUseTags('Gate') @Controller('gate') export class GateController { constructor(public service: GateService) { } }
@Injectable() export class GateService extends TypeOrmCrudService<Gate> { constructor(@InjectRepository(Gate) repo) { super(repo); } }
@Entity() export class Gate { @ApiModelProperty() @PrimaryGeneratedColumn() id: number; @ApiModelProperty() @Column() name: string; @ManyToOne(type => School, school => school.gates, { eager: true, }) @JoinColumn({ name: 'school_id' }) school: School; }
How to get out put as a eager.
The text was updated successfully, but these errors were encountered:
Yo! Thanks for the question! You can load eager relations like so
@Crud({ model: { type: Gate, }, query: { joins: { school: { eager: true, }, }, }, })
Sorry, something went wrong.
Thank you for the help! It works. Another problem is, how to give swagger support for this. its show sample output as like => `
[ { "id": 0, "title": "string", } ]` And eager between 3 relational classes not load.
typeorm is going to deprecate eager and lazy loading see typeorm/typeorm#3251
bashleigh
No branches or pull requests
How to get out put as a eager.
The text was updated successfully, but these errors were encountered: