dnscms: prefetch images and related objects that GraphQL listings resolve per item
This commit is contained in:
6 files changed
+40
-7
No files matched your search
@@ -13,7 +13,9 @@ from dnscms.wordpress.models import DeferWPFieldsManagerMixin, WPImportedPageMix
|
||||
|
||||
|
||||
class NewsPageManager(DeferWPFieldsManagerMixin, PageManager):
|
||||
pass
|
||||
def get_queryset(self):
|
||||
# GraphQL lists load these through here; saves a query per item
|
||||
return super().get_queryset().prefetch_related("featured_image")
|
||||
|
||||
|
||||
@register_singular_query_field("newsIndex")
|
||||
|
||||
Reference in new issue
Block a user