Reduce Query load on intruments query
This commit is contained in:
parent
edf14400ac
commit
56624997da
|
|
@ -2,7 +2,6 @@ query InstrumentsQuery {
|
|||
instruments {
|
||||
id
|
||||
title
|
||||
contents
|
||||
slug
|
||||
language
|
||||
type {
|
||||
|
|
|
|||
|
|
@ -100,8 +100,9 @@ class InstrumentQuery(object):
|
|||
return None
|
||||
|
||||
def resolve_instruments(self, info, **kwargs):
|
||||
return BasicKnowledge.objects.all().order_by("title").live()
|
||||
|
||||
return BasicKnowledge.objects.all().order_by("title").live().select_related("new_type",
|
||||
"locale",
|
||||
"new_type__category")
|
||||
def resolve_instrument_types(self, info, **kwargs):
|
||||
return (
|
||||
InstrumentType.objects.filter(instruments__isnull=False)
|
||||
|
|
|
|||
Loading…
Reference in New Issue