https://github.com/vojtech-dobes/phpstan-php-graphql-server
https://github.com/vojtech-dobes/phpstan-php-graphql-server
ci graphql php phpstan phpstan-rules static-analysis static-code-analysis
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/vojtech-dobes/phpstan-php-graphql-server
- Owner: vojtech-dobes
- License: bsd-3-clause
- Created: 2025-06-03T11:02:25.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-06-03T13:03:08.000Z (11 months ago)
- Last Synced: 2025-06-03T22:16:35.591Z (11 months ago)
- Topics: ci, graphql, php, phpstan, phpstan-rules, static-analysis, static-code-analysis
- Language: PHP
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# PHPStan extension for [PHP GraphQL Server](https://github.com/vojtech-dobes/php-graphql-server)

This is super-convenient companion if you use [`vojtech-dobes/php-graphql-server`](https://github.com/vojtech-dobes/php-graphql-server) and [PHPStan](https://phpstan.org/). With this extension, PHPStan will be able to point out:
- mismatch between GraphQL Schema & what your resolvers actually return
- mismatch between GraphQL Schema & what your resolvers actually accept as arguments
- mismatch between declared parent value type and what resolver will actually receive
- supports utility resolvers like `PropertyFieldResolver` etc.
## Installation
To install the latest version, run the following command:
```
composer require vojtech-dobes/phpstan-php-graphql-server
```
Then you can register in your `phpstan.neon`:
```neon
includes:
- vendor/vojtech-dobes/phpstan-php-graphql-server/extension.neon
graphql:
generatedDir: ""
schemas:
- ""
```
Next you have to tell the extension about your resolvers. If you're using framework integration, use corresponding package:
- **Integration:** `vojtech-dobes/php-graphql-server-nette-integration` (for Nette Framework)
**Package:** [`vojtech-dobes/phpstan-php-graphql-server-nette-integration`](https://github.com/vojtech-dobes/phpstan-php-graphql-server-nette-integration)
In case of custom setup, please implement `Vojtechdobes\PHPStan\GraphQL\Adapter` interface and register like this in `phpstan.neon`:
```neon
services:
- class: MyCustomAdapter
```