bcerati / graphql-kit
PHP应用程序的GraphQL Kit
v0.0.2
2019-08-05 19:34 UTC
Requires
- ext-json: *
- symfony/config: ^4.3
- symfony/dependency-injection: ^4.3
- symfony/http-foundation: ^4.3
- symfony/http-kernel: ^4.3
- symfony/routing: ^4.3
- webonyx/graphql-php: ^0.13.5
This package is auto-updated.
Last update: 2024-09-10 21:19:39 UTC
README
这是一个小库,可以帮助您使用GraphQL和Symfony开发API,无需担心实现完整的GraphQL服务器。
它使用了强大的 graphql-php 库。
安装
使用composer,在您的symfony项目中,您可以执行以下命令
composer require bcerati/graphql-kit
然后注册路由。它将为 POST
端点 /api
创建一个GraphQL服务器
api:
resource: '@BceratiGraphqlKitBundle/Resources/config/routing.yaml'
或者如果您想更改此端点
api:
path: /lala
controller: 'Bcerati\GraphqlKit\Api\Server'
最后,在您的 bundles.php
文件中添加以下内容来注册新安装的包
Bcerati\GraphqlKit\BceratiGraphqlKitBundle::class => ['all' => true],