nestjs-query icon indicating copy to clipboard operation
nestjs-query copied to clipboard

One to many relation

Open FBurner opened this issue 3 years ago • 2 comments

I need to have a one to many relation otherwise the object design is not applicable.

 @Field(() => [CareerLevel], { nullable: true })
  @Prop({ type: [CareerLevelSchema]})
  careerLevels!: Array<CareerLevel>;

This cannot generate the types automaticallly

Have you read the Contributing Guidelines?

yes

Describe the solution you'd like I like that i can define one to many relations

Describe alternatives you've considered there are no alternatives

FBurner avatar Jun 15 '21 23:06 FBurner

@FBurner it looks like you may have figured this out based on the other issue, but you would just leave the @Field decorator off and add it as a relation.

doug-martin avatar Jun 20 '21 02:06 doug-martin

ok, done that seems to work properly, can i somehow use the same relation input type parameters in a custom crudresolver? Is there an example of overwritten resolver relation methods?

FBurner avatar Jun 20 '21 13:06 FBurner