Skip to content

Commit

Permalink
chore(docs): Add required path import to modifying-pages doc (#27883)
Browse files Browse the repository at this point in the history
Co-authored-by: Lennart <lekoarts@gmail.com>
  • Loading branch information
StephanWeinhold and LekoArts committed Nov 9, 2020
1 parent 7eb5111 commit 17a0d52
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/docs/creating-and-modifying-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ This example assumes that each markdown page has a `path` set in the frontmatter
of the markdown file.

```javascript:title=gatsby-node.js
const path = require("path")

// Implement the Gatsby API “createPages”. This is called once the
// data layer is bootstrapped to let plugins create pages from data.
exports.createPages = async ({ graphql, actions, reporter }) => {
Expand Down Expand Up @@ -120,6 +122,7 @@ In the initial approach you have seen how the `gatsby-node.js` file would have a
Using the `id` as an access point to query for other properties in the template is the default approach. However, suppose you had a list of products with properties you would like to query for. Handling the query entirely from `gatsby-node.js` would result in the query looking like this:

```javascript:title=gatsby-node.js
const path = require("path")

exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions;
Expand Down

0 comments on commit 17a0d52

Please sign in to comment.