diff --git a/README.md b/README.md index 06044e4..42a3397 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,93 @@ # GraphQLite bundle Symfony bundle for the `thecodingmachine/graphqlite` package. +It discovers your annotated controllers and types, builds the schema, exposes the `/graphql` endpoint through a PSR-7 +bridge (with optional upload handling), and keeps the Symfony request available as the GraphQL context. -Bundle docs: https://graphqlite.thecodingmachine.io/docs/symfony-bundle +Part of the bundle docs: https://graphqlite.thecodingmachine.io/docs/symfony-bundle See [thecodingmachine/graphqlite](https://github.com/thecodingmachine/graphqlite). + +## Requirements + +- PHP 8.1+ +- Supports: + - Symfony 6.4/7.0/8.0 + - GraphQLite ^8 + +## Installation + +```bash +composer require thecodingmachine/graphqlite-bundle +``` + +Ensure the bundle is enabled (Symfony Flex does this automatically via `config/bundles.php` after `composer require`). + +### Configure routes + +Import the bundle routes to expose `/graphql`: + +```yaml +# config/routes/graphqlite.yaml +graphqlite_bundle: + resource: '@GraphQLiteBundle/Resources/config/routes.php' +``` + +### Configure namespaces + +Tell GraphQLite where to look for controllers and types: + +```yaml +# config/packages/graphqlite.yaml +graphqlite: + namespace: + controllers: App\\GraphQL\\Controller + types: + - App\\GraphQL\\Type + - App\\Entity +``` + +## Quickstart + +Create a controller with GraphQLite attributes: + +```php +