Basic config and layout for fetching, showing wp data with graphql
This commit is contained in:
@@ -17,6 +17,20 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
|
||||
}
|
||||
}
|
||||
`
|
||||
)
|
||||
).then(result => {
|
||||
if (result.errors) {
|
||||
console.log(result.errors)
|
||||
reject(result.errors)
|
||||
}
|
||||
|
||||
result.data.allWordpressPage.edges.forEach(({ node }) => {
|
||||
createPage({
|
||||
path: node.slug,
|
||||
component: path.resolve('./src/pages/page.js'),
|
||||
})
|
||||
})
|
||||
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user