zestic / app-library
v0.13.1
2024-10-16 18:17 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 || ^0.16
- 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
Authentication
GraphQL
In your App
namespace, create the following directory structure
- GraphQL
- Input
- Mutation
- Operation
- Output
- Object
- Query
- Operation
- Output
Then add these files
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 { }
Add
public static function userInfo() { return self::$userInfo ?: (self::$userInfo = new UserInfoObject()); }
Pagination
GraphQL
There is a Paginate
input (paginate is a verb) and a Pagination
output (pagination is a noun).
The inputs and outputs are set up to work with the React Virtualized Infinite Loader