vojtech-dobes / phpstan-php-graphql-server
dev-master
2025-06-05 13:08 UTC
Requires
- php: ~8.4
Requires (Dev)
- nette/di: ^3.2
- php-parallel-lint/php-parallel-lint: ^1.4.0
- phpstan/phpstan: ^2.1.12
- phpstan/phpstan-strict-rules: ^2.0.4
- phpunit/phpunit: ^12.1
- spaze/phpstan-disallowed-calls: ^4.5.0
- tracy/tracy: ^2.10.9
- vojtech-dobes/php-grammar-processing: dev-master@dev
- vojtech-dobes/php-graphql-server: dev-master@dev
This package is auto-updated.
Last update: 2025-06-05 13:09:00 UTC
README
This is super-convenient companion if you use vojtech-dobes/php-graphql-server
and PHPStan. 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
:
includes: - vendor/vojtech-dobes/phpstan-php-graphql-server/extension.neon graphql: generatedDir: "<path to temp directory>" schemas: - "<path to your Schema file>"
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
In case of custom setup, please implement Vojtechdobes\PHPStan\GraphQL\Adapter
interface and register like this in phpstan.neon
:
services: - class: MyCustomAdapter