1. Go to this page and download the library: Download mathsgod/graphql-php-loader 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/ */
mathsgod / graphql-php-loader example snippets
use GraphQL\Loader;
use GraphQL\Type\Schema;
$loader=new Loader();
$config = SchemaConfig::create()
->setQuery($loader->queryType())
->setMutation($loader->mutationType());
$schema = new Schema($config);
return [
"fields"=>[
"first_name"=>"String",
"last_name"=>"String"
]
];
/*
no need create phone in fields,
by create file phone.php in User folder, it auto generate fields in User type
*/