-
Notifications
You must be signed in to change notification settings - Fork 766
Get queryset #528
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
Get queryset #528
Conversation
After reviewing graphql-python/graphene#846 I think this would be better served by a permission class. In the future a DjangoConnectionField could consult it's permissions for more specific permission actions like filtering objects on a connection. |
This is something that I wanted to implement in my project and then I found this PR. There is a lot of cases when I'd like to be able to limit the queryset used underneath when resolving nodes so I think it's a must-have for I took a look at the permissions PR you linked above and I think the solution you proposed is fine for now. Overriding a function that returns the queryset is a common pattern used in class-based views or DRF; it's also simple to use and explicit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good idea!
My attempt at adding support for
DjangoObjectType.get_queryset
as described as Option 1 for #79 ; Tried to match up the method call as much as possible but droppedrequest
andargs
as I wantedget_node
to also be able to callget_queryset
.