Skip to content

fix(site): generate /docs paths from .md files, retry 404s via ISR#3825

Merged
jasonbahl merged 1 commit into
mainfrom
fix/docs-static-paths-source
May 13, 2026
Merged

fix(site): generate /docs paths from .md files, retry 404s via ISR#3825
jasonbahl merged 1 commit into
mainfrom
fix/docs-static-paths-source

Conversation

@jasonbahl
Copy link
Copy Markdown
Collaborator

@jasonbahl jasonbahl commented May 13, 2026

Summary

  • src/pages/docs/[slug].js getStaticPaths was sourcing the pre-render list from the WordPress Primary Nav menu (only ~4 URIs out of ~50 docs), and getStaticProps returned bare { notFound: true } with no revalidate. Any transient build-time fetch failure for those 4 menu-linked docs got cached as a permanent static 404 — ISR could never retry.
  • Currently /docs/intro-to-graphql and /docs/posts-and-pages are stuck this way on production (both URIs from the WP nav menu). The other ~46 docs all serve via fallback: "blocking" and work fine.
  • Switch getStaticPaths to enumerate paths from the actual .md files in plugins/wp-graphql/docs/ via the existing getAllDocUri() helper, and add revalidate: 30 to the notFound branch so transient failures self-heal.

Test plan

  • Verify /docs/intro-to-graphql returns 200 after deploy
  • Verify /docs/posts-and-pages returns 200 after deploy
  • Spot-check several other docs pages (e.g. /docs/introduction, /docs/custom-post-types, /docs/connections) still serve correctly
  • Confirm the docs sidebar links from /docs/introduction all resolve to 200

getStaticPaths was sourcing the pre-render list from the WordPress
Primary Nav menu (only 4 URIs of ~50 docs), and getStaticProps returned
bare { notFound: true } with no revalidate. Any transient build-time
fetch failure for those 4 menu-linked docs got cached as a permanent
static 404 — ISR could never retry. /docs/intro-to-graphql and
/docs/posts-and-pages were stuck this way.

Switch getStaticPaths to enumerate paths from the actual .md files in
plugins/wp-graphql/docs/ (via getAllDocUri), and add revalidate to the
notFound return so transient failures self-heal.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wpgraphql-com Ready Ready Preview, Comment May 13, 2026 6:29pm

@jasonbahl jasonbahl enabled auto-merge (squash) May 13, 2026 18:31
@jasonbahl jasonbahl disabled auto-merge May 13, 2026 18:38
@jasonbahl jasonbahl merged commit 8a0f0a0 into main May 13, 2026
47 checks passed
@jasonbahl jasonbahl deleted the fix/docs-static-paths-source branch May 13, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant