Skip to content

mizcausevic-dev/wpgraphql-query-cost-inspector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPGraphQL Query Cost Inspector

PHP control surface for inspecting WPGraphQL query depth, field hotspots, cacheability pressure, and release risk before a headless rollout goes sideways.

What this repo proves

WPGraphQL issues are rarely just “the server is slow.” The real problem is usually a mix of anonymous query sprawl, nested hotspot fields, weak persisted query discipline, and poor visibility into what is actually driving cost.

Why this repo exists

Headless WordPress teams often discover query cost problems too late. A pricing page pulls too many nested objects. A docs route adds answer-surface joins that blow through cacheability assumptions. Anonymous traffic ends up carrying queries that should have been split or persisted long before release.

wpgraphql-query-cost-inspector models that platform problem directly. It scores query lanes by depth, cost, payload size, latency, cacheability, and auth scope, then turns those signals into a release-friendly inspection surface.

Screenshots

Overview Query matrix Field hotspots Verification

What it includes

  • PHP control plane with HTML proof surfaces and JSON APIs
  • sample WPGraphQL query budgets across marketing, docs, commerce, and account lanes
  • field hotspot analysis for expensive nested joins
  • cacheability and persisted-query posture tracking
  • starter WordPress plugin export for budget headers and policy map examples
  • real browser-rendered README proof assets

Local run

cd wpgraphql-query-cost-inspector
php -S 127.0.0.1:5218 router.php

Open:

Validation

php -l public\index.php
php -l src\Services\QueryCostInspectorService.php
php -l src\Views\render.php
php -l plugin\wpgraphql-query-cost-inspector.php
php scripts\run_demo.php
powershell -ExecutionPolicy Bypass -File .\scripts\smoke_check.ps1
powershell -ExecutionPolicy Bypass -File .\scripts\render_readme_assets.ps1

API routes

  • GET /api/dashboard/summary
  • GET /api/query-matrix
  • GET /api/field-hotspots
  • GET /api/verification
  • GET /api/sample

Plugin starter

Docs

About

PHP control plane for inspecting WPGraphQL query depth, field hotspots, cacheability pressure, and release risk across headless WordPress routes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors