import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit' import { fetchAPI } from '$utils/api' export async function get({}: RequestEvent): Promise { try { const res = await fetchAPI(` query { photo ( limit: 11, sort: ["-date_created"], filter: { status: { _eq: "published" }}, ) { slug title city location { name slug country { slug name flag { id } } } image { id } } } `) const { data } = res return { body: { photos: data.photo } } } catch (error) { return { status: 404, body: error, } } }