简体   繁体   English

尝试将 laravel lighthouse-php 与 Roadrunner 服务器一起使用时遇到间歇性错误

[英]Experiencing intermittent errors when trying to use laravel lighthouse-php with Roadrunner Server

  • Roadrunner 1.8.1跑路者 1.8.1
  • Laravel: 7.17.2 Laravel:7.17.2
  • Lighthouse: 4.15.0灯塔:4.15.0

When using NGINX, I have no issues with my GraphQL API/Schema.使用 NGINX 时,我的 GraphQL API/Schema 没有问题。 However, when I switch to Roadrunner, I suddenly, intermittently get errors like:但是,当我切换到 Roadrunner 时,我突然间断地收到如下错误:

"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.我确实启用了 opcache,但即使禁用了,我仍然遇到这个问题。

I've run php artisan lighthouse:validate-schema, and it is valid I've also run php artisan lighthouse:clear-cache, to no avail我已经运行了 php artisan lighthouse:validate-schema,它是有效的

I suspect this might be to do with the schema caching that Lighthouse uses.我怀疑这可能与 Lighthouse 使用的模式缓存有关。 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解决方案是使用 Artisan 命令lighthouse:clear-cache

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM