From 7daf97ba1c6c2d12d1b2b2200b1f092e3e03e3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Thu, 11 Nov 2021 23:05:04 +0100 Subject: [PATCH] Only aggregate photos/locations/countries that are published --- src/routes/__layout.svelte | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 85b119c..20d6580 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -96,14 +96,21 @@ } # Count - countPhotos: photo_aggregated { + countPhotos: photo_aggregated ( + filter: { status: { _eq: "published" }}, + ) { count { id } } - countTotalPhotosByLocation: photo_aggregated (groupBy: "location") { + countTotalPhotosByLocation: photo_aggregated ( + groupBy: "location", + filter: { status: { _eq: "published" }}, + ) { group count { id } } - countLocations: location_aggregated { + countLocations: location_aggregated ( + filter: { status: { _eq: "published" }}, + ) { count { id } } countCountries: country_aggregated {