程序升级后报错:Failed to load type: OnlineStoreThemePreset. Make sure the type is present in your schema definition.
1、仅在 Linux 中报错:Failed to load type: OnlineStoreThemePreset. Make sure the type is present in your schema definition.。在本地 Windows 10 环境中是可用的。如图1
{ "message": "Failed to load type: OnlineStoreThemePreset. Make sure the type is present in your schema definition.", "exception": "Nuwave\\Lighthouse\\Exceptions\\DefinitionException", "file": "/var/www/object/vendor/nuwave/lighthouse/src/Schema/TypeRegistry.php", "line": 93, "trace": [ { "file": "/var/www/object/vendor/nuwave/lighthouse/src/Schema/TypeRegistry.php", "line": 126, "function": "failedToLoadType", "class": "Nuwave\\Lighthouse\\Schema\\TypeRegistry", "type": "::" }, { "file": "/var/www/object/vendor/nuwave/lighthouse/src/Schema/SchemaBuilder.php", "line": 78, "function": "get", "class": "Nuwave\\Lighthouse\\Schema\\TypeRegistry", "type": "->" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Type/Schema.php", "line": 350, "function": "Nuwave\\Lighthouse\\Schema\\{closure}", "class": "Nuwave\\Lighthouse\\Schema\\SchemaBuilder", "type": "->" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Type/Schema.php", "line": 326, "function": "loadType", "class": "GraphQL\\Type\\Schema", "type": "->" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Utils/AST.php", "line": 580, "function": "getType", "class": "GraphQL\\Type\\Schema", "type": "->" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php", "line": 436, "function": "typeFromAST", "class": "GraphQL\\Utils\\AST", "type": "::" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php", "line": 720, "function": "typeFromAST", "class": "GraphQL\\Utils\\TypeInfo", "type": "::" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php", "line": 672, "function": "getReferencedFieldsAndFragmentNames", "class": "GraphQL\\Validator\\Rules\\OverlappingFieldsCanBeMerged", "type": "->" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php", "line": 123, "function": "collectConflictsBetweenFieldsAndFragment", "class": "GraphQL\\Validator\\Rules\\OverlappingFieldsCanBeMerged", "type": "->" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php", "line": 64, "function": "findConflictsWithinSelectionSet", "class": "GraphQL\\Validator\\Rules\\OverlappingFieldsCanBeMerged", "type": "->" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Language/Visitor.php", "line": 414, "function": "GraphQL\\Validator\\Rules\\{closure}", "class": "GraphQL\\Validator\\Rules\\OverlappingFieldsCanBeMerged", "type": "->" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Language/Visitor.php", "line": 470, "function": "GraphQL\\Language\\{closure}", "class": "GraphQL\\Language\\Visitor", "type": "::" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Language/Visitor.php", "line": 277, "function": "GraphQL\\Language\\{closure}", "class": "GraphQL\\Language\\Visitor", "type": "::" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php", "line": 224, "function": "visit", "class": "GraphQL\\Language\\Visitor", "type": "::" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php", "line": 116, "function": "visitUsingRules", "class": "GraphQL\\Validator\\DocumentValidator", "type": "::" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/GraphQL.php", "line": 153, "function": "validate", "class": "GraphQL\\Validator\\DocumentValidator", "type": "::" }, { "file": "/var/www/object/vendor/webonyx/graphql-php/src/GraphQL.php", "line": 94, "function": "promiseToExecute", "class": "GraphQL\\GraphQL", "type": "::" }, { "file": "/var/www/object/vendor/nuwave/lighthouse/src/GraphQL.php", "line": 268, "function": "executeQuery", "class": "GraphQL\\GraphQL", "type": "::" }, { "file": "/var/www/object/vendor/nuwave/lighthouse/src/GraphQL.php", "line": 203, "function": "executeParsedQuery", "class": "Nuwave\\Lighthouse\\GraphQL", "type": "->" }, { "file": "/var/www/object/vendor/nuwave/lighthouse/src/GraphQL.php", "line": 162, "function": "parseAndExecuteQuery", "class": "Nuwave\\Lighthouse\\GraphQL", "type": "->" }, { "file": "/var/www/object/vendor/nuwave/lighthouse/src/GraphQL.php", "line": 121, "function": "executeOperation", "class": "Nuwave\\Lighthouse\\GraphQL", "type": "->" }, { "file": "/var/www/object/vendor/nuwave/lighthouse/src/Support/Utils.php", "line": 99, "function": "Nuwave\\Lighthouse\\{closure}", "class": "Nuwave\\Lighthouse\\GraphQL", "type": "->" }, { "file": "/var/www/object/vendor/nuwave/lighthouse/src/GraphQL.php", "line": 120, "function": "mapEach", "class": "Nuwave\\Lighthouse\\Support\\Utils", "type": "::" }, { "file": "/var/www/object/vendor/nuwave/lighthouse/src/Support/Http/Controllers/GraphQLController.php", "line": 32, "function": "executeOperationOrOperations", "class": "Nuwave\\Lighthouse\\GraphQL", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php", "line": 48, "function": "__invoke", "class": "Nuwave\\Lighthouse\\Support\\Http\\Controllers\\GraphQLController", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Routing/Route.php", "line": 219, "function": "dispatch", "class": "Illuminate\\Routing\\ControllerDispatcher", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Routing/Route.php", "line": 176, "function": "runController", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 681, "function": "run", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 130, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/object/vendor/nuwave/lighthouse/src/Support/Http/Middleware/AttemptAuthentication.php", "line": 34, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 171, "function": "handle", "class": "Nuwave\\Lighthouse\\Support\\Http\\Middleware\\AttemptAuthentication", "type": "->" }, { "file": "/var/www/object/vendor/nuwave/lighthouse/src/Support/Http/Middleware/AcceptJson.php", "line": 27, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 171, "function": "handle", "class": "Nuwave\\Lighthouse\\Support\\Http\\Middleware\\AcceptJson", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 105, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 683, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 658, "function": "runRouteWithinStack", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 624, "function": "runRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 613, "function": "dispatchToRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 170, "function": "dispatch", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 130, "function": "Illuminate\\Foundation\\Http\\{closure}", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "/var/www/object/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php", "line": 67, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 171, "function": "handle", "class": "Barryvdh\\Debugbar\\Middleware\\InjectDebugbar", "type": "->" }, { "file": "/var/www/object/app/Http/Middleware/ChangeAppUrlMiddleware.php", "line": 23, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 171, "function": "handle", "class": "App\\Http\\Middleware\\ChangeAppUrlMiddleware", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php", "line": 21, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 171, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php", "line": 21, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 171, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php", "line": 27, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 171, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php", "line": 63, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 171, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode", "type": "->" }, { "file": "/var/www/object/vendor/fideloper/proxy/src/TrustProxies.php", "line": 57, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 171, "function": "handle", "class": "Fideloper\\Proxy\\TrustProxies", "type": "->" }, { "file": "/var/www/object/vendor/dingo/api/src/Http/Middleware/Request.php", "line": 111, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 171, "function": "handle", "class": "Dingo\\Api\\Http\\Middleware\\Request", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 105, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 145, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/object/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 110, "function": "sendRequestThroughRouter", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "/var/www/object/public/index.php", "line": 57, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" } ] }
2、执行命令:php artisan cache:clear,清除缓存。接口请求成功。原因在于 GraphQL Schema 缓存在 Redis 中。
/var/www/object # php artisan cache:clear Application cache cleared! /var/www/object #
近期评论