Gatsby pages are created in different ways:
src/pages
into pagescreatePages
API in your site's gatsby-node.js
createPages
APIGatsby will spawn a GraphQL server along with your dev server and you can use that to list all pages.
Navigate to HOST:PORT/___graphql
e.g localhost:8000/___graphql
and past the following query.
{
allSitePage {
edges {
node {
path
component
pluginCreator {
name
pluginFilepath
}
}
}
}
}
In this lesson you will learn how to add React Components inside the src/pages
folder for Gatsby to create pages from them automatically
Instructor: [0:00] Let's go to our project. Inside of pages, let's create a new file, and call it about.js. Here, we would import React and export component.
[0:18] Let's hit save. Let's run our server, and go to /above. You can see here our new created page. Gatsby would automatically create pages from components inside of the pages folder.