-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(gatsby): Get list of /dev-404-page/ pages via graphql #13186
refactor(gatsby): Get list of /dev-404-page/ pages via graphql #13186
Conversation
Not in this PR but something we might want to do is move this to a searchable interface. E.g. show only say 100 pages by default and then people can search using glob or regex syntax. As it is, this query and page don't scale up to very many pages. |
This is dev-only so for that we could use some client-side graphql request (i.e. https://www.npmjs.com/package/graphql-request seems really lightweight) against gatsby schema that uses |
Yep, I was thinking of limiting the results as I was working on this, but decided it was better left to another day. As it is, the page is only real useful for small sites. |
For simple client-side usages of GraphQL, fetch is all you need. |
Added an issue to track the follow-up work #13204 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Published in [email protected] |
Fixed variables Updated to work with gatsbyjs#13186
* Limited to 100 pages rendered. Added search functionality. Fixed variables Updated to work with #13186 * Fix ignore so raw 404 page gets copied over
Description
The
gatsby develop
/dev-404-page/
shows a list of pages on the site. This is currently sourced frompages.json
which is written during bootstrap. #13004 aims to remove reliance on global files such asdata.json
. This PR changes/dev-404-page/
to source the list of pages directly from the runningdevelop
serve via a graphql query, and removes reliance onpages.json
.Note, that this isn't absolutely necessary for #13004, but it does move us closer to a world where the webpack build doesn't need to know about page data.
Related Issues