jerowork / graphql-attribute-schema
Easily build your GraphQL schema for webonyx/graphql-php using PHP attributes instead of large configuration arrays.
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
- shipmonk/composer-dependency-analyser: ^1.8
README
Easily build your GraphQL schema for webonyx/graphql-php using PHP attributes instead of large configuration arrays.
⚠️ Note: This library is still a work in progress. Check out the TODO list for details.
Why use this library?
The webonyx/graphql-php package requires a schema to run a GraphQL server. Normally, this schema is defined using large and complex PHP arrays, making it harder to manage and maintain.
Wouldn’t it be great if there was a simpler, more structured way to define your schema?
That’s exactly what GraphQL Attribute Schema does! 🚀
By adding attributes (#[Mutation]
, #[Query]
, #[Type]
, etc.) directly to your classes, this library automatically generates the GraphQL schema for you; cleaner, faster, and easier to maintain.
📖 Documentation
Documentation is available in the docs directory.