frowhy/gql-nova-app

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

A Nova application built by GraphQL

This package is auto-updated.

Last update: 2021-10-10 16:43:57 UTC


README

A Nova application built by GraphQL

Setup

# 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

Register GraphQL

// 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',
                  ]);