Skip to content

Commit d2da4d1

Browse files
authored
fix(graphql): Resolve N+1 query for StudyLevel translations
1 parent a07b4b8 commit d2da4d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

occurrences/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class Meta:
298298
@classmethod
299299
def get_queryset(cls, queryset, info):
300300
lang = get_language()
301-
return queryset.language(lang)
301+
return queryset.language(lang).prefetch_related("translations")
302302

303303

304304
class ExternalPlace(graphene.ObjectType):

0 commit comments

Comments
 (0)