国内 / app-library
v0.13.0
2024-03-20 05:04 UTC
Requires
- php: ^8.3
- ext-pdo: *
- firebase/php-jwt: ^6.1.0
- iampersistent/config-value-component: ^1.1
- laminas/laminas-authentication: ^2.8.0
- laminas/laminas-db: ^2.20.x-dev
- mezzio/mezzio-authentication: ^1.8.0
- nesbot/carbon: ^2.39
- psr/container: ^1.0 || ^2.0
- ramsey/uuid: ^4.0@dev
- robmorgan/phinx: ^0.15.4
- symfony/dotenv: ^5.2 || ^6.0
- tuupola/cors-middleware: ^1.2.0
- zestic/contracts: ^0.2
Requires (Dev)
- codeception/aspect-mock: dev-master
- codeception/codeception: ^4.1.7
- codeception/module-asserts: dev-master
- codeception/module-db: dev-master
README
认证
GraphQL
在您的 App
命名空间中,创建以下目录结构
- GraphQL
- Input
- Mutation
- Operation
- Output
- Object
- Query
- Operation
- Output
然后添加以下文件 App\GraphQL\Mutation\MutationType
<?php declare(strict_types=1); namespace App\GraphQL\Mutation; use App\GraphQL\Mutation\Operation\UpdateSomethingMutation; use GraphQL\Type\Definition\ObjectType; final class MutationType extends ObjectType { public function __construct() { parent::__construct( [ 'name' => 'Mutation', 'fields' => [ 'updateSomething' => new UpdateSomethingMutation(), ], ] ); } }
App\GraphQL\Mutation\QueryType
<?php declare(strict_types=1); namespace App\GraphQL\Query; use App\GraphQL\Query\Operation\PingQuery; use GraphQL\Type\Definition\ObjectType; final class QueryType extends ObjectType { public function __construct() { parent::__construct( [ 'name' => 'Query', 'fields' => [ 'ping' => new PingQuery(), ], ], ); } }
App\GraphQL\Type\GraphQLType
<?php declare(strict_types=1); namespace App\GraphQL\Type; use App\GraphQL\Type; final class GraphQLType extends Type { }
添加
public static function userInfo() { return self::$userInfo ?: (self::$userInfo = new UserInfoObject()); }
分页
GraphQL
存在一个 Paginate
输入(paginate 是动词)和一个 Pagination
输出(pagination 是名词)。
输入和输出设置为与 React Virtualized Infinite Loader 一起工作