PHP code example of x-graphql / schema-cache

1. Go to this page and download the library: Download x-graphql/schema-cache 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/ */

    

x-graphql / schema-cache example snippets


use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Cache\Psr16Cache;
use XGraphQL\SchemaCache\SchemaCache;

$psr16 = new Psr16Cache(new ArrayAdapter());
$schemaCache = new SchemaCache($psr16);

$schemaCache->save(/* $schema */);

/// Lazy to load on another http requests

$schemaFromCache = $schemaCache->load();