style: auto format
This commit is contained in:
parent
a6bbd0032e
commit
0fe46fe333
|
|
@ -39,43 +39,43 @@ export const route: Route = {
|
|||
|
||||
const ENDPOINT = 'https://api.aeonmedia.co/graphql';
|
||||
const LIST_BY_SECTION = /* GraphQL */ `
|
||||
query getAeonArticlesBySection($section: String!, $sortField: ArticleSortEnum = published_at, $afterCursor: String, $tag: String) {
|
||||
section(site: aeon, slug: $section) {
|
||||
slug
|
||||
title
|
||||
metaDescription
|
||||
}
|
||||
articles(
|
||||
site: aeon
|
||||
section: $section
|
||||
status: [published]
|
||||
tag: $tag
|
||||
sort: {field: $sortField, order: desc}
|
||||
after: $afterCursor
|
||||
first: 24
|
||||
) {
|
||||
nodes {
|
||||
slug
|
||||
...aeonArticleCardFragment
|
||||
query getAeonArticlesBySection($section: String!, $sortField: ArticleSortEnum = published_at, $afterCursor: String, $tag: String) {
|
||||
section(site: aeon, slug: $section) {
|
||||
slug
|
||||
title
|
||||
metaDescription
|
||||
}
|
||||
articles(site: aeon, section: $section, status: [published], tag: $tag, sort: { field: $sortField, order: desc }, after: $afterCursor, first: 24) {
|
||||
nodes {
|
||||
slug
|
||||
...aeonArticleCardFragment
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
pageInfo {
|
||||
hasNextPage
|
||||
endCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fragment aeonArticleCardFragment on Article {
|
||||
id
|
||||
title
|
||||
slug
|
||||
type
|
||||
standfirstLong
|
||||
authors { name }
|
||||
image { url }
|
||||
primaryTopic { title }
|
||||
section { slug }
|
||||
}
|
||||
fragment aeonArticleCardFragment on Article {
|
||||
id
|
||||
title
|
||||
slug
|
||||
type
|
||||
standfirstLong
|
||||
authors {
|
||||
name
|
||||
}
|
||||
image {
|
||||
url
|
||||
}
|
||||
primaryTopic {
|
||||
title
|
||||
}
|
||||
section {
|
||||
slug
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
async function handler(ctx) {
|
||||
|
|
|
|||
|
|
@ -5,34 +5,34 @@ import { getData } from './utils';
|
|||
|
||||
const ENDPOINT = 'https://api.aeonmedia.co/graphql';
|
||||
const LIST_BY_TYPE = /* GraphQL */ `
|
||||
query getAeonArticlesByType($type: [ArticleTypeEnum!], $sortField: ArticleSortEnum = published_at, $afterCursor: String, $tag: String) {
|
||||
articles(
|
||||
site: aeon
|
||||
type: $type
|
||||
status: [published]
|
||||
tag: $tag
|
||||
sort: {field: $sortField, order: desc}
|
||||
after: $afterCursor
|
||||
first: 12
|
||||
) {
|
||||
nodes {
|
||||
slug
|
||||
...aeonArticleCardFragment
|
||||
query getAeonArticlesByType($type: [ArticleTypeEnum!], $sortField: ArticleSortEnum = published_at, $afterCursor: String, $tag: String) {
|
||||
articles(site: aeon, type: $type, status: [published], tag: $tag, sort: { field: $sortField, order: desc }, after: $afterCursor, first: 12) {
|
||||
nodes {
|
||||
slug
|
||||
...aeonArticleCardFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fragment aeonArticleCardFragment on Article {
|
||||
id
|
||||
title
|
||||
slug
|
||||
type
|
||||
standfirstLong
|
||||
authors { name }
|
||||
image { url }
|
||||
primaryTopic { title }
|
||||
section { slug }
|
||||
}
|
||||
fragment aeonArticleCardFragment on Article {
|
||||
id
|
||||
title
|
||||
slug
|
||||
type
|
||||
standfirstLong
|
||||
authors {
|
||||
name
|
||||
}
|
||||
image {
|
||||
url
|
||||
}
|
||||
primaryTopic {
|
||||
title
|
||||
}
|
||||
section {
|
||||
slug
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const route: Route = {
|
||||
|
|
|
|||
|
|
@ -9,29 +9,41 @@ import { parseDate } from '@/utils/parse-date';
|
|||
const ENDPOINT = 'https://api.aeonmedia.co/graphql';
|
||||
|
||||
const ESSAY = /* GraphQL */ `
|
||||
query getAeonEssay($slug: String!) {
|
||||
essay(slug: $slug) {
|
||||
publishedAt
|
||||
updatedAt
|
||||
authors { name authorBio }
|
||||
audioUrl
|
||||
image { url alt caption }
|
||||
body
|
||||
query getAeonEssay($slug: String!) {
|
||||
essay(slug: $slug) {
|
||||
publishedAt
|
||||
updatedAt
|
||||
authors {
|
||||
name
|
||||
authorBio
|
||||
}
|
||||
audioUrl
|
||||
image {
|
||||
url
|
||||
alt
|
||||
caption
|
||||
}
|
||||
body
|
||||
}
|
||||
}
|
||||
}`;
|
||||
`;
|
||||
|
||||
const VIDEO = /* GraphQL */ `
|
||||
query getAeonVideo($slug: String!, $site: SiteEnum!) {
|
||||
video(slug: $slug, site: $site) {
|
||||
publishedAt
|
||||
updatedAt
|
||||
authors { name authorBio }
|
||||
hoster
|
||||
hosterId
|
||||
credits
|
||||
description
|
||||
query getAeonVideo($slug: String!, $site: SiteEnum!) {
|
||||
video(slug: $slug, site: $site) {
|
||||
publishedAt
|
||||
updatedAt
|
||||
authors {
|
||||
name
|
||||
authorBio
|
||||
}
|
||||
hoster
|
||||
hosterId
|
||||
credits
|
||||
description
|
||||
}
|
||||
}
|
||||
}`;
|
||||
`;
|
||||
|
||||
const renderVideoDescription = (article) => {
|
||||
let video = article.hosterId;
|
||||
|
|
|
|||
Loading…
Reference in New Issue