Closed KCH0000 closed 6 months ago
Think you need to remove:
@FilterableField(() => [PartPriceDTO])
partPrice: PartPriceDTO[];
As that is already done by the @UnPagedRelation('partPrice', () => PartPriceDTO)
You would also need to add the id fields, otherwise the mapper will not be able to map to the correct entities.
@ManyToOne((): ObjectType<PartEntity> => PartEntity, (part) => part.partPrice)
@JoinColumn({ name: 'part_id' })
part!: PartEntity;
@Column({ name: 'part_id' })
partId!: PartEntity;
Thanks for the help I deleted
@FilterableField(() => [PartPriceDTO])
and did not delete it
partPrice: PartPriceDTO[];
so that Resolver would not output a type error in Entity and DTO
and rename fied part -> partId, to avoid making a record
@Column({ name: 'part_id' })
partId!: PartEntity;
Error: No fields found to create GraphQLFilter for PartPriceDTO
I'm trying very hard, but I don't understand how it works :)
Hmm, could you create repo with the issue? Then I can check it out for ya.
Thanks, if you update one field in PartPriceDTO
to have FilterableField
it will work.
Oh my God). Thank you so much, you saved me a lot of time. I would never have guessed before these changes.
I can't set up UnPagedRelation.
There is a One to Many connection (Part -> Part Price) my code
part.dto.ts
part.entity.ts
part-price.dto.ts
part-price.entity.ts
Error
Desktop (please complete the following information):
Then i use
Error: No fields found to create GraphQLFilter for PartPriceDTO
and if empty Field
Error: Undefined type error. Make sure you are providing an explicit type for the "partPrice" of the "PartDTO" class.