PHP code example of zestic / graphql-component

1. Go to this page and download the library: Download zestic/graphql-component 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 / graphql-component example snippets


    ConfigAggregator::ENABLE_CACHE => true,

'graphQL'      => [
    'mutations'    => [
        'addEmailToList'   => App\Domain\Message\Mutation\AddEmailToListMessage::class,
        'addEmailToList'                    =>  [
            'bus' => 'messenger.not-default-bus', \\ optional
            'handler' => App\Domain\Handler\Mutation\AddEmailToListHandler::class,
            'message' => App\Domain\Message\Mutation\AddEmailToListMessage::class,
        ],
    ],
    'queries'      => [
        'ping'                    =>  [
            'bus' => 'messenger.not-default-bus', \\ optional
            'handler' => App\Domain\Handler\Query\PingHandler::class,
            'message' => App\Domain\Message\Query\PingMessage::class,
        ],
    ],
    'middleware'   => [
        'allowedHeaders' => [
            'application/graphql',
            'application/json',
        ],
    ],
    'schema'       => App\GraphQL\Schema::class,
];
 
$postProcessors = [
    \Zestic\GraphQL\ConfigProcessor::class,
];
$aggregator = new ConfigAggregator([
        ...
    ], $cacheConfig['config_cache_path'], $postProcessors); 

return $aggregator->getMergedConfig();