-
Notifications
You must be signed in to change notification settings - Fork 818
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
Django: How to use a query argument in order to exclude nodes matching a specific filter? #305
Comments
My problem might rather concern |
I should have posted in graphene-django. Sorry. |
No worries! |
@vwrobel You can use a django method filter I would just pass in a dict that has a value and exclude
then you can just pass an object into your graphql query kinda like you would a mutation! :D |
Thanks a lot @BossGrand! Updating to graphene-django 1.0, I have been able to do what I wanted with the following query definition:
I will try the solution you propose! |
First of all, thanks a lot for your work. This project is awesome.
If possible, I would appreciate some hints on setting up a query with 'exclude' filter option.
I have some video items in a Django/Graphene backend setup. Each video item is linked to one owner.
In a React app, I would like to query via GraphQL all the videos owned by the current user on the one hand and all the videos NOT owned by the current user on the other hand.
I could run the following GraphQl query and filter on the client side:
I would rather have two queries with filters parameters directly asking relevant data to my backend. Something like:
I would query with
ownerName = currentUserName
andexclude = True/False
yet I just cannot retrieve myexclude
argument on my backend side. Here is the code I have tried in my schema.py file:My custom
SceneFilter
is used but I do not know how to pass theexclude
arg to it. (I do not think that I am making a proper use of the resolver). Any help on that matter would be much appreciated!PS: I have asked this question on SO
The text was updated successfully, but these errors were encountered: