Skip to the guide
All guides

Headless and WPGraphQL

Review or build a decoupled WordPress site that serves its content through WPGraphQL. The skill checks what the API exposes, how previews work and how the frontend stays fresh.

app WordPress DevKit 2.0.3checked reading 4 minutes

On this page

When to use it

Use this skill when WordPress feeds a separate frontend through WPGraphQL. It covers what the schema exposes, draft and preview access, authentication, query limits, Smart Cache and persisted queries, and webhooks that tell the frontend to refresh. Plain REST routes and ACF storage design belong to other skills.

Other skills for nearby topics

Some questions are better answered elsewhere:

  • REST route design and permissions: wp-devkit-rest-api-development.
  • ACF storage, field keys and migrations: wp-devkit-acf-and-content-modeling.
  • Reachable XSS, authorization or SSRF defects: wp-devkit-security-review.
  • Slow queries and object cache tuning: wp-devkit-performance-review.
  • Pipeline and deploy steps: wp-devkit-ci-cd-and-release-engineering.
  • Gutenberg block output: wp-devkit-block-development.

Run a review in Claude

With the plugin loaded, start a read-only review of one bounded target:

Text
/wp-devkit:headless-review <target-path>

The short form /wp-devkit:headless asks for a quick scan.

Run a review in Codex, ChatGPT or Antigravity

Name the installed skill and keep the request small. Replace the target with your files or the journey you care about.

Text
$wp-devkit-headless-and-wpgraphql
Review the target without editing files.
Read the project instructions and the skill's engineering contract first.
Separate confirmed findings from candidates and state the evidence and checks you could not run.

The engineering contract is the set of rules every DevKit skill follows, such as how severity is graded and what counts as evidence.

Reference files

The agent loads only the file that matches your task:

  • wpgraphql-schema-and-limits.md explains what the schema exposes, how types and fields are registered, the authorization model, query limits and resolver cost.
  • preview-and-authentication.md applies when drafts leak or are missing, or when previews fail. It covers authentication methods, the preview flow, CORS and boundary tests.
  • caching-revalidation-and-webhooks.md helps with stale pages. It covers cache layers, Smart Cache, route mapping, webhook senders and receivers, and Next.js revalidation.
  • contract-testing-and-operations.md covers schema snapshots, how tightly the frontend depends on the schema, redirects of the WordPress front end, monitoring and rollout.

How a review runs

  1. The agent follows one rendered route back to its query, its resolver and its content model. It keeps the schema names that consumers already use.
  2. It compares what an anonymous visitor, a low-privilege user and a preview credential can read. The content states are published, draft, private, password-protected, scheduled and trashed. Hiding a field in the frontend does not protect the resolver on the origin.
  3. It traces the preview path: link creation, secret or token checks, the redirect target, where the credential lives, use of asPreview and how the cache separates previews.
  4. It checks the endpoint settings against how exposed the site is. These are introspection, depth, batch limit, connection maximum, debug mode and endpoint restriction. A worst-case query is measured on staging before the agent calls it a risk.
  5. For caching, it names who owns freshness in each layer and which event invalidates it. It maps content changes (publish, rename, unpublish, scheduled posts, terms, menus) to the routes they affect.
  6. It checks webhook authentication, which means a signature over the raw body plus a timestamp. It also looks at replay handling, retries and whether failures are visible.
  7. It reports where visibility and freshness end, with the evidence it gathered. During a review it never triggers rebuilds, purges or revalidation.

Sometimes the evidence is not enough, for example when there is no staging site, no frontend access or unknown CDN behavior. The report then says what is unverified and which check would settle it.

What you get back

A review starts with the result and the scope that was reviewed. Each confirmed finding lists its severity, file:line, the actor, the trigger, the reachable path, the impact, confidence, a minimal fix and a regression test. Candidates and unverified items sit in a separate list.

An implementation report lists the boundaries that changed, whether schema changes are additive or breaking, the commands run with their exit status, the checks not run, the remaining risk and the rollback.

Note

Reviews are read-only. A clean review covers the code that was inspected and is not a certification. Ask for implementation as a separate, bounded task with a regression check.

Where to go next

Use review to fix to turn findings into a bounded change. Use Doctor and reports for environment checks and evidence tooling.