frowhy / gql-nova-app

由 GraphQL 构建的 Nova 应用程序

安装: 1

依赖项: 0

建议者: 0

安全: 0

星标: 8

关注者: 2

分支: 7

公开问题: 0

类型:项目

This package is auto-updated.

Last update: 2024-09-10 22:46:38 UTC


README

由 GraphQL 构建的 Nova 应用程序

设置

# 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

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