5
  • Roadrunner 1.8.1
  • Laravel: 7.17.2
  • Lighthouse: 4.15.0

When using NGINX, I have no issues with my GraphQL API/Schema. However, when I switch to Roadrunner, I suddenly, intermittently get errors like:

"message": "Lighthouse failed while trying to load a type: MyType\n\nMake sure the type is present in your schema definition.\n",
    "exception": "Nuwave\\Lighthouse\\Exceptions\\DefinitionException",
    "file": "/var/www/wright/ams/vendor/nuwave/lighthouse/src/Schema/TypeRegistry.php",
    "line": 94

Has anyone else experienced this and found a solution?

I did have opcache enabled, but even with that disabled, I'm still experiencing this issue.

I've run php artisan lighthouse:validate-schema, and it is valid I've also run php artisan lighthouse:clear-cache, to no avail

jake downs
  • 331
  • 3
  • 9
  • 1
    I'm seeing the same issue with Laravel 7.30.4, Lighthouse 4.18 and PHP 7.4.10 using fpm. Did you find an answer? – Samuel Feb 16 '21 at 22:43

1 Answers1

2

I suspect this might be to do with the schema caching that Lighthouse uses. If you're deploying a schema with a new type but retaining an old cache then I would suspect you would see an error like this.

The solution would be to clear the lighthouse cache using the Artisan command lighthouse:clear-cache

Samuel
  • 2,331
  • 1
  • 22
  • 40