I have calculated field - added on the fly in overriden find/findOne methods in a controller.
This works fine for field creation and it is accessible on my front-end.
But, when I want to filter by the same field via REST parameter - it does not work - like the filter is not even there.
Yes - i get this “calculated” field in response from server - JSON is exactly as expected.
But when using in filter - no dice. That is the problem.
I wonder if this could be cause by that old issue where filters are messed up with what current user can see (is allowed to see) - even though this should be public for front-end use? And since this is calculated field (or virtual as some call it) - could that be a problem? Quite odd behavior anyway.
Could be that the query is senatized out. you can test it by calling the sanitize query manualy and checking the output.
see the following code from the docs Controllers | Strapi Documentation
Already checked - as I said, the query returns everything as expected - JSON in response contains this new field as part of each product item/entity. It just does not want to filter by it.