jerowork / graphql-attribute-schema
Build your GraphQL schema for webonyx/graphql-php using PHP attributes instead of array-based configuration.
Requires
- php: ^8.3
- psr/container: ^2.0
- roave/better-reflection: ^6.51
- webonyx/graphql-php: ^15.19
Requires (Dev)
- captainhook/captainhook: ^5.24
- friendsofphp/php-cs-fixer: ^3.66
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
- rector/rector: ^2.0
- rregeer/phpunit-coverage-check: ^0.3
- scrutinizer/ocular: ^1.9
- shipmonk/composer-dependency-analyser: ^1.8
This package is auto-updated.
Last update: 2025-06-11 22:46:58 UTC
README
Build your GraphQL schema for webonyx/graphql-php using PHP attributes instead of array-based configuration.
Why use this library?
The webonyx/graphql-php package requires a schema to run a GraphQL server. Normally, this schema is defined based on array configuration.
This package introduces PHP attributes to configure your GraphQL schema instead. By adding attributes (#[Mutation]
, #[Query]
, #[Type]
, etc.) directly to your classes, this library automatically generates the GraphQL schema for you.
📖 Documentation
The documentation is available on GitHub pages or in the GitHub repository.
There is also an example application using most of the features at https://github.com/jerowork/example-application-graphql-attribute-schema.