Basic config and layout for fetching, showing wp data with graphql

This commit is contained in:
Moris Zen
2018-06-25 10:53:58 +02:00
parent 57f717fec0
commit d145e29086
6 changed files with 111 additions and 1 deletions

10
src/pages/404.js Normal file
View File

@@ -0,0 +1,10 @@
import React from 'react'
const NotFoundPage = () => (
<div>
<h1>NOT FOUND</h1>
<p>You just hit a route that doesn&#39;t exist... the sadness.</p>
</div>
)
export default NotFoundPage

9
src/pages/index.js Normal file
View File

@@ -0,0 +1,9 @@
import React from 'react'
const IndexPage = () => (
<div>
<h1>Index page</h1>
</div>
)
export default IndexPage

24
src/pages/page.js Normal file
View File

@@ -0,0 +1,24 @@
import React, { Component } from 'react';
class Page extends Component {
render() {
const { data } = this.props
return (
<div>
<h1>Specific Page - {data.wordpressPage.title}</h1>
</div>
);
}
}
export const query = graphql`
query PageQuery {
wordpressPage(slug: {eq: "about"}) {
title
slug
content
}
}
`
export default Page;