PHP code example of fnash / graphql-qb

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

    

fnash / graphql-qb example snippets




nash\GraphQL\Query;

$query = Query::create('article')
    ->variables([
        '$withTags' => 'Boolean = false',
    ])
    ->fields([
        'id',
        'title',
        'body',
        'myLanguageAlias' => 'language',
        'tags' => Query::create()->fields([
            'id',
            'tagLabel' => 'label',
            'language',
            'taxonomy' => Query::create()->fields([
                'id',
                'label',
                'language'
            ]),
        ])
    ])
    ->