php - laravel graphql playground 设置时出错
问题描述
在灯塔教程中设置此软件包时,出现此错误我现在可以做什么?
https://github.com/mll-lab/laravel-graphql-playground
作曲家
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0",
"mll-lab/laravel-graphql-playground": "^1.0",
"nuwave/lighthouse": "^2.6"
},
错误
In Router.php line 363:
Argument 1 passed to Illuminate\Routing\Router::group() must be of the type array, string giv en,
called in D:\Laravel\lighthouse-tutorial\vendor\laravel\framework\src\Illuminate\Support\ Facades\Facade.php on line 223
--
In Router.php line 363:
Argument 1 passed to Illuminate\Routing\Router::group() must be of the type
array, string given, called in D:\Laravel\lighthouse-tutorial\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 223
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with er ror code 1
--
更新
配置文件
<?php
return [
// Route for the frontend
'route' => 'graphql-playground',
// Which middleware to apply, if any
'middleware' => [
// 'web',
],
// Route for the GraphQL endpoint
'endpoint' => 'graphql',
// Control if the playground is accessible at all
// This allows you to disable it completely in production
'enabled' => env('GRAPHQL_PLAYGROUND_ENABLED', true),
];
当我删除它时问题就在这里'route' => 'graphql-playground',
解决方案
我发现GraphQLPlaygroundServiceProvider.php
他们正在使用路由组:
Route::group(
config('graphql-playground.route'),
...
但是路由组需要一个数组参数,所以我通过更改配置文件解决了这个问题:
'route' => 'graphql-playground',
作为数组的路由:
'route' => ['graphql-playground'],
这为我解决了这个问题。
推荐阅读
- python - read values from text file in python
- rust - `Option 的动态替换
>>>` - java - 为什么我的程序忽略了scanner.nextLine()?
- oracle-apex - Oracle apex 升级错误:在 Oracle VM 上从 19 升级到 21.1 时,出现以下错误:ORA-22288: file or LOB operation FILEOPEN failed
- python - 我想将 python 输出列表转换为数组
- javascript - 在图像 HTML/Javascript 上书写
- java - 对象引用不影响它引用的对象?
- go - 使用 bufio.NewScanner 提高阅读性能
- python - 如何在 seaborn.lineplot 中将所有线条更改为黑色?
- javascript - 关于幻灯片。需要在列表中获取幻灯片的第一张图片