PHP code example of zestic / app-library

1. Go to this page and download the library: Download zestic/app-library library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zestic / app-library example snippets



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(),
                ],
            ]
        );
    }
}


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(),
                ],
            ],
        );
    }
}



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());
    }