zidaneus/graphiql-bundle

Symfony GraphiQLBundle 使您能够在symfony项目中渲染UI

安装: 39

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 0

分支: 26

类型:symfony-bundle

1.0.1 2024-06-18 21:54 UTC

This package is auto-updated.

Last update: 2024-09-18 22:38:06 UTC


README

此Symfony包提供了将GraphiQL接口集成到您的Symfony应用程序的功能

Build Status Coverage Status Latest Stable Version Latest Unstable Version Total Downloads

安装

步骤a) 下载包

在项目目录下

composer require --dev overblog/graphiql-bundle

Symfony Flex安装

注意 如果您使用的是Symfony Standard,请转到下一节

步骤a) 接受来自Symfony Flex的contrib recipes安装

-  WARNING  overblog/graphiql-bundle (0.1): From github.com/symfony/recipes-contrib
    The recipe for this package comes from the "contrib" repository, which is open to community contributions.
    Do you want to execute this recipe?
    [y] Yes
    [n] No
    [a] Yes for all packages, only for the current installation session
    [p] Yes permanently, never ask again for this project
    (defaults to n):

步骤b) 如果您没有twig

在项目目录下

composer require twig

如果您只使用twig为graphiql,您可能需要在composer require时使用--dev

Symfony Standard安装

步骤a) 在'dev'部分启用包

// in app/AppKernel.php
class AppKernel extends Kernel
{
    // ...

    public function registerBundles()
    {
        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            // ...
            $bundles[] = new Overblog\GraphiQLBundle\OverblogGraphiQLBundle();
        }
    }
}

步骤b) 启用GraphiQL端点

# in app/config/routing_dev.yml
overblog_graphiql_endpoint:
    resource: "@OverblogGraphiQLBundle/Resources/config/routing.xml"

完成

现在已完成,导航到项目URL中的/graphiql

更多

社区

贡献