Make GraphQL queries more compact
This commit is contained in:
@@ -4,25 +4,23 @@ import { fetchAPI } from '$utils/api'
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
try {
|
||||
const res = await fetchAPI(`
|
||||
query {
|
||||
settings {
|
||||
newsletter_page_text
|
||||
}
|
||||
|
||||
newsletter (
|
||||
limit: -1,
|
||||
sort: "-issue",
|
||||
filter: { status: { _eq: "published" }},
|
||||
) {
|
||||
issue
|
||||
title
|
||||
date_sent
|
||||
link
|
||||
thumbnail { id }
|
||||
}
|
||||
const res = await fetchAPI(`query {
|
||||
settings {
|
||||
newsletter_page_text
|
||||
}
|
||||
`)
|
||||
|
||||
newsletter (
|
||||
limit: -1,
|
||||
sort: "-issue",
|
||||
filter: { status: { _eq: "published" }},
|
||||
) {
|
||||
issue
|
||||
title
|
||||
date_sent
|
||||
link
|
||||
thumbnail { id }
|
||||
}
|
||||
}`)
|
||||
|
||||
const { data } = res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user