Skip to content

Instantly share code, notes, and snippets.

@ghankerson
Created May 30, 2019 19:59
Show Gist options
  • Select an option

  • Save ghankerson/7c7834ed71457615aa4cf2ad70c55885 to your computer and use it in GitHub Desktop.

Select an option

Save ghankerson/7c7834ed71457615aa4cf2ad70c55885 to your computer and use it in GitHub Desktop.
import { gql } from 'apollo-boost';
export function episodesQuery(contextSlug, pageNum) {
return gql`
{
episodesList: collection(contentAreaSlug: "${contextSlug}", slug: "${contextSlug}" ) {
id
title
results(page: ${pageNum}, pageSize: 18) {
nextPage
pageSize
totalPages
totalItems
previousPage
currentPage
items {
id
title
body
resourceType
publishDate
description
canonicalSlug
primaryVisuals {
thumbnail {
aspect_ratios: aspectRatios {
widescreen {
instances {
width
height
url
}
}
uncropped {
instances {
width
height
url
}
}
}
contentArea
dateTaken
dateline
fallback
longCaption
shortCaption
xid
}
}
audio {
title
durationHms
encodings {
httpFilePath
}
}
... on Link {
destination
}
}
totalItems
nextPage
}
}
}
`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment