question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prefetch related with named arguments and objects

See original GitHub issue

Hi @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:open
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tfoxycommented, Jun 18, 2019

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.

0reactions
wodCZcommented, May 20, 2020

Hi, have you managed to get this working?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found