Get counts from API

This commit is contained in:
2021-09-27 23:17:49 +02:00
parent 917f25353d
commit d9c02671c2

View File

@@ -6,11 +6,13 @@
import Footer from '$components/organisms/Footer.svelte'
export let data: any
export let count: any
// Set global data
setContext('global', data)
// console.log(data)
setContext('global', {
...data,
count,
})
</script>
<slot />
@@ -56,6 +58,17 @@
instagram
footer_links
}
# Count
photo_aggregated {
count { id }
}
location_aggregated {
count { id }
}
country_aggregated {
count { id }
}
}
`)
@@ -64,6 +77,11 @@
return {
props: {
data,
count: {
photos: data.photo_aggregated[0].count.id,
locations: data.location_aggregated[0].count.id,
countries: data.country_aggregated[0].count.id,
},
}
}
}