Skip to content

Conversation

@vixducis
Copy link

@vixducis vixducis commented Aug 6, 2025

Sometimes, I come across a situation where I want to apply filters on multiple queries in one request. Each of the filters in the request may only apply to one of the queries. In that case, an InvalidFilterQuery will be thrown because not all filters are valid for all queries.

I'm aware that this can be disabled with the query-builder.disable_invalid_filter_query_exception config variable, but I'd like to keep throwing exceptions in most cases, but when one of these special cases arise, disable it on the QueryBuilder level.

This should keep the current default functionality as-is and not introduce any breaking changes. If this is not suitable for the project or you may have any other questions, please let me know.

@4RSIM3R
Copy link

4RSIM3R commented Aug 18, 2025

Totally agree on this approach...

@freekmurze
Copy link
Member

Could you add a test for the new function?

@vixducis
Copy link
Author

Regarding the tests: will do.

Should similar functionality be added for the other actions (sorts, includes) as well to keep the functionality uniform?

@AlexVanderbist
Copy link
Member

Hi @vixducis, thanks for the PR! Adding this override to sorts and includes sounds like a good idea to keep this package's feature set uniform, but we can tackle those in a different PR. As soon as we've got some tests for this PR, I'm happy to merge this in to keep things moving along.

@AlexVanderbist AlexVanderbist removed their request for review September 3, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants