Skip to content

Instantly share code, notes, and snippets.

@jeremeylduvall
Created Dec 13, 2017
Embed
What would you like to do?
Final index.js
// External
import React from 'react';
import Link from 'gatsby-link';
// Internal
import Header from '../components/header';
const IndexPage = ( props ) => {
const bio = props.data.allWordpressWpMe.edges[0].node.description;
const username = props.data.allWordpressWpMe.edges[0].node.name;
const avatar = props.data.allWordpressWpMe.edges[0].node.avatar_urls.wordpress_96;
return (
<div>
<Header bio={ bio } username={ username } src={ avatar } />
</div>
)
}
export default IndexPage
export const pageQuery = graphql`
query IndexQuery {
allWordpressWpMe {
edges {
node {
name
description
avatar_urls {
wordpress_96
}
}
}
}
}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment