WPGraphQL is a free, open-source plugin that adds an extendable GraphQL API to any WordPress site. Your post types, taxonomies, users, media and custom fields become one typed schema. The frontend sends a query to a single endpoint, /graphql, and gets back only the fields it asked for.
Why developers use it
- One request for related content instead of a REST waterfall or a heavy
_embed - Exact shape: each component asks for exactly what it displays
- Typed, self-documenting schema you can explore in GraphiQL from the WordPress admin
- Extensible with
register_graphql_fieldandregister_graphql_type - Cacheable public reads with
GETplus persisted queries
What to lock before launch
The default setup is developer-friendly, not production-safe:
- Public introspection off
- Query depth limiting on
- Page size capped with
graphql_connection_max_query_amount GET+ persisted queries for public reads- Related lookups batched through loaders, not one query per node (N+1)
- Thin resolvers that call the same service layer as your REST endpoints
The series
What it is, how it works, real examples, where it’s used, benefits, challenges and FAQ, built from our hands-on WPGraphQL + Next.js guide: GraphQL for Headless WordPress in Practice.
👉 Series page: 4wp.dev/wpgraphql
Primary source: wpgraphql.com · WordPress.org plugin · GitHub
WPGraphQL name and logo © WPGraphQL contributors, GPL-3.0. 4wp.dev is an independent educational series, not affiliated with WPGraphQL.