PHP code example of linkorb / graphael
1. Go to this page and download the library: Download linkorb/graphael 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/ */
linkorb / graphael example snippets
use Graphael\Server;
use Symfony\Component\Dotenv\Dotenv;
$loader = le_exists($envFilename)) {
$dotenv = new Dotenv();
$dotenv->load($envFilename);
}
// Application level configuration
$config = [
'environment_prefix' => 'MY_API_',
'type_namespace' => 'MyApi\\Type', //
'type_path' => __DIR__ . '/../src/Type' // Directory to scan for Type classes
'type_postfix' => 'Type',
];
// Instantiate a GraphQL server based on the configuration
$server = new Server($config);
$server->handleRequest();