PHP code example of elephentity / codegen-tsquid

1. Go to this page and download the library: Download elephentity/codegen-tsquid 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/ */

    

elephentity / codegen-tsquid example snippets


$initial = new \Eleph\Tsquid\InitialData(
    \Eleph\Tsquid\Manifest::fromFile(__DIR__ . '/generated/tsquid/tsquid-manifest.php'),
    static fn ($text, $variables, $operation, $id) =>
        $application->executeGraphQL($text, $variables, $operation),
);
$response = $initial->render($_SERVER['REQUEST_URI'], $htmlShell);
foreach ($response->headers as $name => $value) {
    header($name . ': ' . $value);
}
echo $response->body;