Skip to content

Commit 3db1dcd

Browse files
committed
Add to docs on debugging pages
1 parent 971db18 commit 3db1dcd

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

docs/docs/creating-and-modifying-pages.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ Pages can be created in three ways:
1313
You can also implement the API [`onCreatePage`](/docs/node-apis/#onCreatePage) to
1414
modify pages created in core or plugins or to create client-only pages.
1515

16+
## Debugging help
17+
18+
To see what pages are being created by your code or plugins, you can query
19+
for page information while developing in Graph*i*QL. Paste the following
20+
query in the Graph*i*QL IDE for your site.
21+
22+
```graphql
23+
{
24+
allSitePage {
25+
edges {
26+
node {
27+
path
28+
component
29+
}
30+
}
31+
}
32+
}
33+
```
34+
35+
You can also query for any `context` data you or plugins added to pages.
36+
1637
## Creating pages in gatsby-node.js
1738

1839
Often you will need to programmatically create pages. For example, you have

packages/gatsby/src/bootstrap/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,11 @@ data
305305
await writePages()
306306
console.timeEnd(`write out pages modules`)
307307

308+
// Update Schema for SitePage.
309+
console.time(`Updating schema`)
310+
await require(`../schema`)()
311+
console.timeEnd(`Updating schema`)
312+
308313
const checkJobsDone = _.debounce(resolve => {
309314
const state = store.getState()
310315
if (state.jobs.active.length === 0) {

0 commit comments

Comments
 (0)