Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "Return value of Nuwave\Lighthouse\Execution\BaseRequest::query() must be of the type string, null returned" on "/graphql" endpoint. #730

Closed
IamSwap opened this issue Apr 12, 2019 · 3 comments · Fixed by #989

Comments

@IamSwap
Copy link

IamSwap commented Apr 12, 2019

First of all, thank you for making this great package.

I am using the latest version of the lighthouse. It was working fine until yesterday. But now, I am getting Return value of Nuwave\Lighthouse\Execution\BaseRequest::query() must be of the type string, null returned on /graphql endpoint.

I tried making fresh Laravel project & installed the package but had no luck. Also tried on a different machine with fresh Laravel project.

Output/Logs

Click to expand
Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Return value of Nuwave\Lighthouse\Execution\BaseRequest::query() must be of the type string, null returned"

Stacktrace:
#37 Symfony\Component\Debug\Exception\FatalThrowableError in /Volumes/Work/Sites/lara/vendor/nuwave/lighthouse/src/Execution/BaseRequest.php:50
#36 Nuwave\Lighthouse\Execution\BaseRequest:query in /Volumes/Work/Sites/lara/vendor/nuwave/lighthouse/src/GraphQL.php:124
#35 Nuwave\Lighthouse\GraphQL:executeRequest in /Volumes/Work/Sites/lara/vendor/nuwave/lighthouse/src/Support/Http/Controllers/GraphQLController.php:85
#34 Nuwave\Lighthouse\Support\Http\Controllers\GraphQLController:executeBatched in /Volumes/Work/Sites/lara/vendor/nuwave/lighthouse/src/Support/Http/Controllers/GraphQLController.php:69
#33 Nuwave\Lighthouse\Support\Http\Controllers\GraphQLController:query in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54
#32 call_user_func_array in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54
#31 Illuminate\Routing\Controller:callAction in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45
#30 Illuminate\Routing\ControllerDispatcher:dispatch in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Route.php:219
#29 Illuminate\Routing\Route:runController in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Route.php:176
#28 Illuminate\Routing\Route:run in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Router.php:680
#27 Illuminate\Routing\Router:Illuminate\Routing\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30
#26 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104
#25 Illuminate\Pipeline\Pipeline:then in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Router.php:682
#24 Illuminate\Routing\Router:runRouteWithinStack in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Router.php:657
#23 Illuminate\Routing\Router:runRoute in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Router.php:623
#22 Illuminate\Routing\Router:dispatchToRoute in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Router.php:612
#21 Illuminate\Routing\Router:dispatch in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176
#20 Illuminate\Foundation\Http\Kernel:Illuminate\Foundation\Http\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30
#19 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /Volumes/Work/Sites/lara/vendor/fideloper/proxy/src/TrustProxies.php:57
#18 Fideloper\Proxy\TrustProxies:handle in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#17 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#16 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21
#15 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#14 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#13 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21
#12 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#11 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#10 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27
#9 Illuminate\Foundation\Http\Middleware\ValidatePostSize:handle in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#8 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#7 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:62
#6 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode:handle in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#5 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#4 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104
#3 Illuminate\Pipeline\Pipeline:then in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151
#2 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in /Volumes/Work/Sites/lara/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116
#1 Illuminate\Foundation\Http\Kernel:handle in /Volumes/Work/Sites/lara/public/index.php:55
#0 require in /Users/swapnil/.composer/vendor/laravel/valet/server.php:158

Environment

Lighthouse Version: 3.2.1
Laravel Version: 5.7
PHP Version: 7.2

@IamSwap IamSwap changed the title Getting "Return value of Nuwave\Lighthouse\Execution\BaseRequest::query() must be of the type string, null returned" on fresh installation. Getting "Return value of Nuwave\Lighthouse\Execution\BaseRequest::query() must be of the type string, null returned" on "/graphql" endpoint. Apr 12, 2019
@spawnia
Copy link
Collaborator

spawnia commented Apr 12, 2019

You are most probably sending an empty query.

The error message is cryptic though, this is why we created #669

@spawnia spawnia closed this as completed Apr 12, 2019
@adaosantos
Copy link

I have the some problem, I follow the tutorial on site and see this message.
Apparently the GraphQL controller don't receive the post params

image

@jasbirsmindfiresolutions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants