ncrypthic/doctrine-graphql-bundle

Symfony bundle for ncrypthic/doctrine-graphql library

1.4.0 2020-07-03 04:29 UTC

README

This is a Symfony bundle for ncrypthic/doctrine-graphql library

Installation

composer require ncrypthic/doctrine-graphql-bundle

Configuration

  1. Enable the bundle in Symfony's AppKernel
<?php
// file: app/AppKernel.php

    public function registerBundles()
    {
        $bundles = array(
            // ... other bundles
            new LLA\DoctrineGraphQLBundle\DoctrineGraphQLBundle(),
        );
    }
  1. Configure the bundle
# file: app/config/config.yml
lla_doctrine_graphql:
    cache_service: cache.app # default
    entity_manager_service: doctrine.orm.default_entity_manager
    debug: false # GraphQL error debugging, default: false
  1. Add graphql route
    graphql:
        path: /graphql
        method: POST
        defaults: { _controller: LLADoctrineGraphQLBundle:DoctrineGraphQL:graphql }