Closed webard closed 2 years ago
Thanks for the report. Unfortunately I've never tried Octan so it will take some time to install and debug.
I think one of reason can be something from this documentation: https://laravel.com/docs/9.x/octane#dependency-injection-and-octane
I try do something by myself and open PR, but your help will be great value. Your package is awesome, and with Octane, which is supported by Lighthouse too, is 10x faster.
I cannot reproduce it with Swoole v4.8.11, Laravel v9.29.0, Octane v1.3.1, Lighthouse v5.60.0 and Lara v1.0.4.
Could you please check value of LIGHTHOUSE_QUERY_CACHE_ENABLE
and if it is enabled try to disable it? Or maybe you can create a repo with minimal reproduction?
Sure, I try to prepare repository.
Problem solved. I had code like this:
class GraphQLServiceProvider extends ServiceProvider
{
public function boot(): void
{
$typeRegistry = app(TypeRegistry::class);
$dispatcher = app(\Illuminate\Contracts\Events\Dispatcher::class);
$dispatcher->listen(
\Nuwave\Lighthouse\Events\BuildSchemaString::class,
function () use ($typeRegistry): string {
...
And calling $typeRegistry or $dispatcher like above causes problem when Swoole was booted (on second request).
I changed this to:
Event::listen(
\Nuwave\Lighthouse\Events\BuildSchemaString::class,
function (): string {
$typeRegistry = app(TypeRegistry::class);
...
and problem was gone.
Hi,
on Laravel Octane with Swoole, and when LIGHTHOUSE_CACHE is set to false, after second request there is a bug:
First request is always successful. When cache is enable, everything is OK. My schema is super simple:
and the query is:
All versions of framework, lighthouse and lara-asp are latest: 9.28, 5.58.2, 1.0.4.