PHP code example of infinityloop-dev / graphpinator-nette

1. Go to this page and download the library: Download infinityloop-dev/graphpinator-nette 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/ */

    

infinityloop-dev / graphpinator-nette example snippets


$router[] = new Route('/', [
    'module' => 'Graphpinator',
    'presenter' => 'Api',
]);

$router[] = new Route('/schema.graphql',
    'module' => 'Graphpinator',
    'presenter' => 'Schema',         
    'action' => 'html',
]);

$router[] = new Route('/graphiql',
    'module' => 'Graphpinator',
    'presenter' => 'GraphiQl',         
    'action' => 'default',
]);

interface SlideAccessor
{
    public function getSlideSingle() : SlideSingle;

    public function getSlideDouble() : SlideDouble;

    public function getSlideTriple() : SlideTriple;
}

 declare(strict_types = 1);

namespace App\GraphQL\Public;

final class Schema extends \Graphpinator\Typesystem\Schema
{
    public function __construct(\Graphpiantor\SimpleContainer $container)
    {
        parent::__construct($container, $container->getType('Query'), $container->getType('Mutation'));

        $this->setDescription('My GraphQL API');
    }
}