Update findGalleries to only fetch imageCount instead of all images (#941)

This commit is contained in:
InfiniteTF
2020-11-15 04:40:47 +01:00
committed by GitHub
parent c74f145224
commit ba8b3b29a4
8 changed files with 57 additions and 23 deletions

View File

@@ -108,3 +108,8 @@ func (r *galleryResolver) Performers(ctx context.Context, obj *models.Gallery) (
qb := models.NewPerformerQueryBuilder()
return qb.FindByGalleryID(obj.ID, nil)
}
func (r *galleryResolver) ImageCount(ctx context.Context, obj *models.Gallery) (int, error) {
qb := models.NewImageQueryBuilder()
return qb.CountByGalleryID(obj.ID)
}