laracomponents/graphql
适用于Laravel的GraphQL & Relay
0.2.2
2017-08-22 06:19 UTC
Requires
- php: >=5.6.4
- youshido/graphql: ^1.5
Requires (Dev)
- orchestra/testbench: 3.1.*|3.2.*|3.3.*|3.4.*
- phpunit/phpunit: ~5.0|~6.0
This package is not auto-updated.
Last update: 2024-09-15 02:43:08 UTC
README
简介
GraphQL & Relay for Laravel
要求
- PHP 5.6.4+ 或更高版本
- Laravel 5.1 或更高版本
安装
使用composer安装此包
composer require laracomponents/graphql
打开config/app.php并在提供者数组中添加以下内容
'providers' => [ // ... LaraComponents\GraphQL\ServiceProvider::class, ],
发布配置文件
php artisan vendor:publish --provider="LaraComponents\GraphQL\ServiceProvider"
简单使用
创建一个模式
$ php artisan make:graphql:scheme DefaultSchema
创建一个类型
$ php artisan make:graphql:type UserType Which type would you like to create?: [0] AbstractType [1] AbstractScalarType [2] AbstractObjectType [3] AbstractMutationObjectType [4] AbstractInputObjectType [5] AbstractInterfaceType [6] AbstractEnumType [7] AbstractListType [8] AbstractUnionType
创建一个字段
$ php artisan make:graphql:field UsersField
文档
所有详细文档可在主GraphQL仓库中找到 - http://github.com/youshido/graphql/.
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。