ncrypthic/doctrine-graphql-bundle

Symfony扩展,用于ncrypthic/doctrine-graphql库

1.4.0 2020-07-03 04:29 UTC

README

这是一个用于ncrypthic/doctrine-graphql库的Symfony扩展

安装

composer require ncrypthic/doctrine-graphql-bundle

配置

  1. 在Symfony的AppKernel中启用该扩展
<?php
// file: app/AppKernel.php

    public function registerBundles()
    {
        $bundles = array(
            // ... other bundles
            new LLA\DoctrineGraphQLBundle\DoctrineGraphQLBundle(),
        );
    }
  1. 配置该扩展
# 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. 添加graphql路由
    graphql:
        path: /graphql
        method: POST
        defaults: { _controller: LLADoctrineGraphQLBundle:DoctrineGraphQL:graphql }