mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-10 16:22:20 +03:00
docs: added warning to authorization
This commit is contained in:
parent
f80bf5f006
commit
ccce70e3cd
|
@ -144,6 +144,16 @@ If you are using ``DjangoObjectType`` you can define a custom `get_queryset`.
|
||||||
return queryset.filter(published=True)
|
return queryset.filter(published=True)
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
Defining a custom ``get_queryset`` gives the guaranteed it will be called
|
||||||
|
when resolving the ``DjangoObjectType``, even through related objects.
|
||||||
|
Note that because of this, benefits from using ``select_related``
|
||||||
|
in objects that define a relation to this ``DjangoObjectType`` will be canceled out.
|
||||||
|
In the case of ``prefetch_related``, the benefits of the optimization will be lost only
|
||||||
|
if the custom ``get_queryset`` modifies the queryset. For more information about this, refers
|
||||||
|
to Django documentation about ``prefetch_related``: https://docs.djangoproject.com/en/4.2/ref/models/querysets/#prefetch-related.
|
||||||
|
|
||||||
|
|
||||||
Filtering ID-based Node Access
|
Filtering ID-based Node Access
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user