thecodingmachine / graphqlite-bundle
A Symfony bundle for thecodingmachine/graphqlite.
Installs: 1 477 038
Dependents: 4
Suggesters: 0
Security: 0
Stars: 36
Watchers: 13
Forks: 43
Open Issues: 4
Type:symfony-bundle
pkg:composer/thecodingmachine/graphqlite-bundle
Requires
- php: >=8.1
- ext-json: *
- laminas/laminas-diactoros: ^2.2.2 || ^3
- nyholm/psr7: ^1.1
- overblog/graphiql-bundle: ^0.2 || ^0.3 || ^1
- symfony/config: ^6.4 || ^7.0 || ^8.0
- symfony/console: ^6.4 || ^7.0 || ^8.0
- symfony/framework-bundle: ^6.4 || ^7.0 || ^8.0
- symfony/psr-http-message-bridge: ^2.0 || ^7.0 || ^8.0
- symfony/translation: ^6.4 || ^7.0 || ^8.0
- symfony/validator: ^6.4 || ^7.0 || ^8.0
- thecodingmachine/cache-utils: ^1
- thecodingmachine/graphqlite: ^8
- thecodingmachine/graphqlite-symfony-validator-bridge: ^7.1.1
Requires (Dev)
- beberlei/porpaginas: ^1.2 || ^2.0
- composer/package-versions-deprecated: ^1.8
- composer/semver: ^3.4
- phpstan/phpstan: ^2
- phpstan/phpstan-symfony: ^2.0
- symfony/phpunit-bridge: ^6.4 || ^7 || ^8.0
- symfony/security-bundle: ^6.4 || ^7.0 || ^8.0
- symfony/yaml: ^6.4 || ^7.0 || ^8.0
Suggests
- symfony/security-bundle: To use #[Logged] or #[Right] attributes
Conflicts
- phpdocumentor/type-resolver: <1.4
- symfony/event-dispatcher: <4.3
- symfony/routing: <4.3
- symfony/security-core: <4.3
- v7.2.0
- v7.1.2
- v7.1.1
- v7.1.0
- v7.0.0
- 6.x-dev
- v6.1.1
- v6.1.0
- 6.0.x-dev
- dev-master / 6.0.x-dev
- v6.0.3
- v6.0.2
- v6.0.1
- v6.0.0
- v6.0.0-beta.0
- v5.4.0
- v5.0.0
- v4.1.4
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- 4.0.x-dev
- v4.0.8
- v4.0.7
- v4.0.6
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.0.0
- dev-fix/support-ecodev-graphql-upload-v8
- dev-revert-119-master
This package is auto-updated.
Last update: 2025-12-11 09:21:45 UTC
README
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.
Part of the bundle docs: https://graphqlite.thecodingmachine.io/docs/symfony-bundle
See thecodingmachine/graphqlite.
Requirements
- PHP 8.1+
- Supports:
- Symfony 6.4/7.0/8.0
- GraphQLite ^8
Installation
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:
# config/routes/graphqlite.yaml graphqlite_bundle: resource: '@GraphQLiteBundle/Resources/config/routes.php'
Configure namespaces
Tell GraphQLite where to look for controllers and types:
# config/packages/graphqlite.yaml graphqlite: namespace: controllers: App\\GraphQL\\Controller types: - App\\GraphQL\\Type - App\\Entity
Quickstart
Create a controller with GraphQLite attributes:
<?php // src/GraphQL/Controller/HelloController.php namespace App\GraphQL\Controller; use TheCodingMachine\GraphQLite\Annotations\Query; final class HelloController { #[Query] public function hello(string $name = 'world'): string { return sprintf('Hello %s', $name); } }
Features
- Auto-discovers controllers and types from configured namespaces and registers GraphQLite services, query providers, type mappers, and middleware through Symfony autoconfiguration
- Ships a
/graphqlroute that converts Symfony requests to PSR-7 and keeps the Symfony request in the GraphQL context - Passes the Symfony request as context to allow using them in queries/mutations
- Supports multipart uploads when
graphql-uploadis installed - Integrates with Symfony Security for
#[Logged]/#[Right]checks - Expose
login/logoutmutations plus amequery (opt-out) - Symfony Validator-based user input validation
- Lets you cap introspection, query depth, and query complexity via configuration
- Uses Symfony cache (APCu or PHP files) for schema caching
- Includes a
graphqlite:dump-schemaconsole command to export GraphQL SDL
GraphiQL (playground)
The bundle wires Overblog’s GraphiQL bundle if it is installed. See https://github.com/overblog/GraphiQLBundle for
enabling the UI alongside the /graphql endpoint.
Development
- Tests:
vendor/bin/phpunit - Static analysis:
composer phpstan