Prefetch related with named arguments and objects
See original GitHub issueHi @tfoxy, following #22, we are unable to actually know what when we are getting called from:
prefetch_related(info, *args[, **kwargs?])
https://github.com/tfoxy/graphene-django-optimizer/blob/1d7032d79bf891aa7842a6ee3d72f860fbf158bd/graphene_django_optimizer/query.py#L241-L250
We could whether have as first or second argument first
, last
, filter
, foo
, etc.
We would like to get a **kwargs
instead. But we can’t both pass *args
and **kwargs
to prevent any breaking change for any of the optimizer users.
I believe users using the arguments from *args
should be still safe if they are properly using the field name… Otherwise, it will break for sure.
What do you think? Could we get such change in and release it as a major change?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
using select_related and prefetch_related with many arguments
Simple answer. No, there isn't a downside. Real Answer. Prefetch related does the join on the python side. Most of the time this...
Read more >16937 (Prefetch related objects) - Django's bug tracker
This method causes the requested related objects to be retrieved in a single batch when the main QuerySet is evaluated.
Read more >Prefetch_related and select_related functions in django
In Django, select_related and prefetch_related are designed to stop the deluge of database queries that are caused by accessing related ...
Read more >Prefetch Related and Select Related in Django - Medium
I have added Prefetch to set new attributes for us. We are fetching values from publishers field using Person.objects.only('id','name') as base ...
Read more >All You Need To Know About Prefetching in Django
The new object allows the developer to override the query used by Django to prefetch the related objects. In our previous example Django...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Github is not allowing me to transfer the repo as I “don’t have the permission to create repositories on mirumee”. I added you as collaborators for now. We can keep talking through email to coordinate the transfer if you prefer.
Hi, have you managed to get this working?