Adrinalin4ik / Nestjs-Graphql-Tools

NestJS Graphql Tools is a flexible solution that provides a bunch of decorators for solving problems like n+1 request, filtering, sorting, pagination, polymorphic relation, graphql field extraction. It is fully based on decorators. To use it you can just add a decorator to your resolver.
GNU General Public License v3.0
79 stars 8 forks source link

Make sure to restore excludedFilterFields at initialization of metadata #46

Closed bobsingor closed 6 days ago

bobsingor commented 2 months ago

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

Adrinalin4ik commented 1 month ago

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?

bnol commented 1 month ago

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

bobsingor commented 1 month ago

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.

bnol commented 1 month ago

Same problem for SortingField

bobsingor commented 1 month ago

Same problem for SortingField

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

bnol commented 3 weeks ago

@bobsingor I think you can also update SortingField accordingly

Adrinalin4ik commented 2 weeks ago

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