Nestjs-Graphql-Tools icon indicating copy to clipboard operation
Nestjs-Graphql-Tools copied to clipboard

Make sure to restore excludedFilterFields at initialization of metadata

Open bobsingor opened this issue 1 year ago • 2 comments

The exclude on field decorator is currently not working because it is not properly restored from metadata at initialization of GraphqlFilterTypeDecoratorMetadata.

This pull request fixes that issue

bobsingor avatar Sep 08 '24 20:09 bobsingor

It think it doesn't work for you because you're using both decorators at the same time like this

  @FilterField(() => String, { sqlExp: 't.title'})
  @FilterField({exclude: true})

Can you show your DTO?

Adrinalin4ik avatar Sep 17 '24 16:09 Adrinalin4ik

this PR fixes my issue https://github.com/Adrinalin4ik/Nestjs-Graphql-Tools/issues/48

bnol avatar Oct 03 '24 04:10 bnol

It think it doesn't work for you because you're using both decorators at the same time like this

  @FilterField(() => String, { sqlExp: 't.title'})
  @FilterField({exclude: true})

Can you show your DTO?

No I am using only one decorator per field. Try using multiple fields with exclude property in your DTO. Only one will work.

bobsingor avatar Oct 05 '24 00:10 bobsingor

Same problem for SortingField

bnol avatar Oct 05 '24 08:10 bnol

Same problem for SortingField

I added that one also to the PR! @Adrinalin4ik Please take a look and verify this issue #48!

bobsingor avatar Oct 07 '24 14:10 bobsingor

@bobsingor I think you can also update SortingField accordingly

bnol avatar Oct 17 '24 11:10 bnol

PR look good so far. I wanna test it tomorrow and if everything is fine, then merge it. Thanks for fixing it.

Adrinalin4ik avatar Oct 23 '24 19:10 Adrinalin4ik