Wednesday 20 November 2019

TypeORM - Relation with property path ** in entity was not found

(see https://www.reddit.com/r/learnjavascript/comments/dy287f/typeorm_relation_with_property_path_projectrole/ for more in-depth explanation )I am struggling with joining from my projectsParticipants model. The thing that is unique about this model is that it uses field resolvers instead of @ManyToOne relations in the resolver itself.```@Field(() => projectsRoles)async projectRole(@Root() projectRole: projectsRoles) {return await projectsRoles.findOne({project_role_id: projectRole.project_role_id});}```When trying to join contacts or projectsRoles into projectsParticipants, I get an error when trying to select columns from the models I've joined. My "contact" column is also having problems. The thing that is unique about my contact column is that it has a composite primary key, so the field looks like this:```@Field(() => contacts, { nullable: true })async contactPerson(@Root() contact: contacts) {return await contacts.findOne({contact_id: this.contact_person_id,company_id: contact.company_id});}```

Submitted November 20, 2019 at 08:36AM by Xarnius

No comments:

Post a Comment