[英]Experiencing intermittent errors when trying to use laravel lighthouse-php with Roadrunner Server
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.