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

Infinite depth in DTO but not in suscriptions

Open VelaJafet opened this issue 1 year ago • 3 comments

Hello, i'm reading your documentation.

I read that I can add the next to modify the filterInput in the DTO, it works!

image

And in the suscriptions I can filter but is setup like filterDepth: 0 'cause I can't access to the direct relations

image

image

Have you thought about to add the same logic to the filter of suscriptions? I have to do some weird things to filter created/updated things in front end, for example validate that the createdElement has the same company with a useEffect instead just get the createdElement that is mine

VelaJafet avatar Jan 18 '24 20:01 VelaJafet

That's a good question, I'm not sure we can support inifity depth as those filters (If I remember correctly) are stringified and stored in a map, so that could potentially bring some issues.

What would the needed depth be for your use case?

TriPSs avatar Jan 18 '24 20:01 TriPSs

The filtering on subscriptions also wrok different as in they are not filtered on the database currently but on the plain object itself, so that would maybe explain why you can't filter on relations.

PS: I'm on my phone so can't check how to implementation currently is.

TriPSs avatar Jan 18 '24 20:01 TriPSs

That's a good question, I'm not sure we can support inifity depth as those filters (If I remember correctly) are stringified and stored in a map, so that could potentially bring some issues.

What would the needed depth be for your use case?

I have the next entity:

Log:

  • id
  • companyId
  • others fields like deletedAt, concepto, etc as you can see in the last screenshot

I just can access to the filter strings, numbers but not to the directs relations like company->id, it seems like depthFilter is 0 :s, i just need depthFilter: 1 or 2

VelaJafet avatar Jan 22 '24 19:01 VelaJafet