category.ts
@Entity('categoryenter code here')
export class Category{
@PrimaryGeneratedColumn({ type: 'int' })
id: Category;
@OneToMany(() => Category, category => category.category,{eager:true})
categoryList: Category[];
@ManyToOne(() => Category, (category) => category.categoryList)
category: Category;
}
The Category entity is above(mysql). I want to find a category with all it's children like this
await categoryRepo.findOne({
where:{ id: 1 },
relations:['categoryList']
})
But I got an error Maximum call stack size exceeded
What am I suppose to do