PHP code example of frowhy / gql-nova-app

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

    

frowhy / gql-nova-app example snippets


// Register Schema
GraphQL::addSchema('default', [
    'query'    => [
        'users' => 'App\GraphQL\Query\UsersQuery',
    ],
    'mutation' => [
        'signIn'   => 'App\GraphQL\Mutation\SignInMutation',
        'authTest' => 'App\GraphQL\Mutation\AuthTestMutation',
    ],
]);
// Register Types
GraphQL::addTypes([
                      'App\GraphQL\Type\UserType',
                      'App\GraphQL\Type\AuthTestType',
                      'App\GraphQL\Type\AccessTokenType',
                  ]);
 bash
# pull submodule
$ git submodule init
$ git submodule update

# install dependencies
$ composer install

# install Nova's service provider and public assets
$ php artisan nova:install
$ php artisan migrate

# generate jwt secret
$ php artisan jwt:secret

# serve with hot reload at localhost:8000
$ php artisan serve