Search by

thecodingmachine / graphqlite-bundle

moufthecodingmachine

A Symfony bundle for thecodingmachine/graphqlite.

Package info

github.com/thecodingmachine/graphqlite-bundle

Homepage

Type:symfony-bundle

pkg:composer/thecodingmachine/graphqlite-bundle

Statistics

Installs: 1 852 674

Dependents: 3

Suggesters: 0

Stars: 38

Open Issues: 2

v7.7.0 2026-10-30 23:15 UTC

README

Latest Stable Version License Build Status

GraphQLite bundle

Symfony bundle for GraphQLite: build a GraphQL API by adding PHP attributes (#[Query], #[Mutation], #[Type], #[Field]...) to your classes. The bundle exposes the /graphql endpoint and integrates GraphQLite with Symfony services, Security, Validator, file uploads and cache.

Documentation: docs/index.rst

Requirements

  • PHP 8.1+
  • Symfony 6.4, 7.x or 8.x
  • GraphQLite ^8

Quick start

  1. Install the bundle (Symfony Flex enables it and creates its configuration):

    composer require thecodingmachine/graphqlite-bundle
  2. Tell GraphQLite where your GraphQL classes live:

    # config/packages/graphqlite.yaml
    graphqlite:
        namespace:
            controllers: App\GraphQL\Controller\
            types:
                - App\Entity\
                - App\GraphQL\Input\
  3. Write your first query and call /graphql:

    // src/GraphQL/Controller/HelloController.php
    namespace App\GraphQL\Controller;
    
    use TheCodingMachine\GraphQLite\Annotations\Query;
    
    class HelloController
    {
        #[Query]
        public function hello(string $name = 'world'): string
        {
            return sprintf('Hello %s', $name);
        }
    }

Continue with the getting started tutorial.

Development

  • Tests: vendor/bin/simple-phpunit
  • Static analysis: composer phpstan
  • The code examples of docs/ are tested: they must stay identical to the classes of tests/DocsFixtures/ (see tests/DocsExamplesTest.php).