Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AND clause used instead of OR while filtering #1519

Open
belavaishali opened this issue Apr 17, 2024 · 0 comments
Open

AND clause used instead of OR while filtering #1519

belavaishali opened this issue Apr 17, 2024 · 0 comments
Labels

Comments

@belavaishali
Copy link

belavaishali commented Apr 17, 2024

Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.

  • What is the current behavior?
    So currently on using a Filterset class graphene-django filter is used, which uses AND instead of OR for lookup "IN"

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    a github repo, https://repl.it or similar (you can use this template as a starting point: https://repl.it/@jkimbo/Graphene-Django-Example).

class ExampleFilterSet(FilterSet):    
    label__name__in = StringInFilter(method="filter_labels")

    class Meta:
        model = Example
        fields = {"users__email": ["in"]}

Ideally, here it should have been OR query - where users__email in ['[email protected]' , '[email protected]'] but on debugging it simply empties the clone object and returns empty qs.

It was working well with django3.1 and graphene-django 2.9.9

  • What is the expected behavior?
    The OR clause should be there in the ultimate sql query formed

  • What is the motivation / use case for changing the behavior?
    carry the normal functioning

  • Please tell us about your environment:

    • Version: 3.1.2
    • Platform: macos
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant