Skip to content

Instantly share code, notes, and snippets.

@dance2die
Last active June 16, 2018 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/6d6b4234050801d4c90b05ea64fd5396 to your computer and use it in GitHub Desktop.
Save dance2die/6d6b4234050801d4c90b05ea64fd5396 to your computer and use it in GitHub Desktop.
// imports and stuff ...
...
// "data" is passed by Gatsby with result of "StoriesQuery"
const IndexPage = ({ data }) => (
<Stories stories={data.allTopStories.edges} title="Top Stories" />
)
export default IndexPage
export const query = graphql`
query StoriesQuery {
allTopStories {
edges {
node {
id
storyId
item {
id
title
score
by
time
type
url
}
}
}
}
}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment