PHPackages                             axepress/wp-graphql-stubs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. axepress/wp-graphql-stubs

ActiveLibrary[API Development](/categories/api)

axepress/wp-graphql-stubs
=========================

WPGraphQL function and class declaration stubs for static analysis.

v2.6.0(5mo ago)8559.4k↑72.5%111MITPHPCI passing

Since Oct 1Pushed 3w ago1 watchersCompare

[ Source](https://github.com/AxeWP/wp-graphql-stubs)[ Packagist](https://packagist.org/packages/axepress/wp-graphql-stubs)[ Docs](https://github.com/axewp/wp-graphql-stubs)[ GitHub Sponsors](https://github.com/AxeWp)[ RSS](/packages/axepress-wp-graphql-stubs/feed)WikiDiscussions main Synced 4d ago

READMEChangelogDependencies (3)Versions (144)Used By (11)

WPGraphQL Stubs
===============

[](#wpgraphql-stubs)

Provides stub declarations for [WPGraphQL](https://www.wpgraphql.com/) core functions, classes and interfaces. These stubs can help plugin and theme developers leverage static analysis tools like [PHPStan](https://github.com/phpstan/phpstan).

The stubs are generated with [php-stubs/generator](https://github.com/php-stubs/generator).

Requirements
------------

[](#requirements)

- PHP 7.3+
- Sodium PHP extension as latest WordPress core uses it and **compat code is removed** from stubs.

Installation
------------

[](#installation)

Require this package as a development dependency with [Composer](https://getcomposer.org).

```
composer require --dev axepress/wp-graphql-stubs
```

Alternatively you may download `wp-graphql-stubs.php` directly.

Usage with PHPStan
------------------

[](#usage-with-phpstan)

```
composer require --dev phpstan/phpstan szepeviktor/phpstan-wordpress axepress/wp-graphql-stubs
```

The package [`szepeviktor/phpstan-wordpress`](https://github.com/szepeviktor/phpstan-wordpress)depends on [`phpstan/phpstan`](http://github.com/phpstan/phpstan). Please do read [that package's README](https://github.com/szepeviktor/phpstan-wordpress/blob/master/README.md)and see the `example` directory over there.

Versioning
----------

[](#versioning)

This package is versioned to match the WPGraphQL version from which the stubs are generated.

When changes are made to the actual stub generation that require a new release, the old release is *deleted* and a new tag is created with the format `x.x.x+repack.y` where `x.x.x` is the WPGraphQL version and `y` is the the repack iteration. This is necessary because Composer's SemVer implementation ignores build meta when determining the latest version.

If you already have an old build of the version installed, you will need to run `composer update --no-cache` to get the latest repack.

Generating stubs for a different WPGraphQL version
--------------------------------------------------

[](#generating-stubs-for-a-different-wpgraphql-version)

1. Clone this repository and `cd` into it.
2. Update `"wpackagist-plugin/wp-graphql": "x.x.x"` in `composer.json` with the desired version
3. Run `composer update`
4. Run `composer generate`

The `wp-graphql-stubs.php` file should now be updated.

Prior Art
---------

[](#prior-art)

- Based on [php-stubs/woocommerce-stubs](https://github.com/php-stubs/woocommece-stubs).
- Inspired by the original [wp-graphql-stubs](https://github.com/Poolshark/wp-graphql-stubs) project.

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance84

Actively maintained with recent releases

Popularity43

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 84.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Recently: every ~0 days

Total

139

Last Release

165d ago

Major Versions

v1.31.1 → v2.0.0-beta.22025-02-07

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29322304?v=4)[Dovid Levine](/maintainers/justlevine)[@justlevine](https://github.com/justlevine)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (276 commits)")[![justlevine](https://avatars.githubusercontent.com/u/29322304?v=4)](https://github.com/justlevine "justlevine (38 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (7 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")

---

Tags

hacktoberfesthacktoberfest2023php-stubswordpresswp-graphqlwpgraphqlPHPStanwordpressstatic analysisgraphqlwpgraphqlwp-graphql

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/axepress-wp-graphql-stubs/health.svg)

```
[![Health](https://phpackages.com/badges/axepress-wp-graphql-stubs/health.svg)](https://phpackages.com/packages/axepress-wp-graphql-stubs)
```

###  Alternatives

[php-stubs/woocommerce-stubs

WooCommerce function and class declaration stubs for static analysis.

953.5M104](/packages/php-stubs-woocommerce-stubs)[wp-graphql/wp-graphql-woocommerce

WooCommerce bindings for WPGraphQL

70556.6k](/packages/wp-graphql-wp-graphql-woocommerce)[szepeviktor/phpstan-wordpress

WordPress extensions for PHPStan

33110.3M1.4k](/packages/szepeviktor-phpstan-wordpress)[php-stubs/acf-pro-stubs

Advanced Custom Fields PRO stubs for static analysis.

75813.5k86](/packages/php-stubs-acf-pro-stubs)[php-stubs/wp-cli-stubs

WP-CLI function and class declaration stubs for static analysis.

302.9M136](/packages/php-stubs-wp-cli-stubs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
