PHP code example of commadore / graphql-qb

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

    

commadore / graphql-qb example snippets




ommadore\GraphQL\Operation;
use Commadore\GraphQL\Query;

        $operation = new Operation(Query::KEYWORD, 'article');
        $query1 = new Query('article', [
            'id' => 999,
            'title' => 'Hello World',
            'note' => 3.5,
        ], [
            'id',
            'title',
            'body',
        ]);
        $operation->fields(['article' => $query1]);

        echo $operation;