type-graphql

Entity metadata for Role#users was not found

≡放荡痞女 提交于 2020-03-23 14:12:08
问题 Trying to make a OneToMany and ManyToOne relationship with typeorm but i get this error, i don't know what's wrong with my code. i have a User table: import { BaseEntity, Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'; import { Field, ID, ObjectType } from 'type-graphql'; import { Role } from './'; @ObjectType() @Entity() export class User extends BaseEntity { @Field(() => ID) @PrimaryGeneratedColumn() public id: number; @Field() @Column('text', { unique: true }) public