在 Lighthouse 中报错:Failed to load type: ThemeSettingRange. Make sure the type is present in your schema definition.
1、在 Lighthouse 中报错:Failed to load type: ThemeSettingRange. Make sure the type is present in your schema definition.。在 GraphQL 客户端中查看请求,存在错误提示。如图1
{ "errors": [ { "debugMessage": "Failed to load type: on OnlineStoreThemeSettingRange. Make sure the type is present in your schema definition.", "message": "Internal server error", "extensions": { "category": "schema" }, "locations": [ { "line": 38, "column": 3 } ], "path": [ "onlineStore", "theme", "on OnlineStoreThemeSettingsCategories", 0, "settings", 0 ], "trace": [ { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\Schema\\TypeRegistry.php", "line": 126, "call": "Nuwave\\Lighthouse\\Schema\\TypeRegistry::failedToLoadType('ThemeSettingRange')" }, { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\Schema\\TypeRegistry.php", "line": 534, "call": "Nuwave\\Lighthouse\\Schema\\TypeRegistry::get('ThemeSettingRange')" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Type\\Definition\\InterfaceType.php", "line": 130, "call": "Nuwave\\Lighthouse\\Schema\\TypeRegistry::Nuwave\\Lighthouse\\Schema\\{closure}(array(12), instance of Nuwave\\Lighthouse\\Schema\\Context, instance of GraphQL\\Type\\Definition\\ResolveInfo)" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 940, "call": "GraphQL\\Type\\Definition\\InterfaceType::resolveType(array(12), instance of Nuwave\\Lighthouse\\Schema\\Context, instance of GraphQL\\Type\\Definition\\ResolveInfo)" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 789, "call": "GraphQL\\Executor\\ReferenceExecutor::completeAbstractValue(GraphQLType: OnlineStoreThemeSetting, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(6), array(12))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 741, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStoreThemeSetting, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(6), array(12))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 654, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStoreThemeSetting, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(6), array(12))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 887, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValueCatchingError(GraphQLType: OnlineStoreThemeSetting, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(6), array(12))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 761, "call": "GraphQL\\Executor\\ReferenceExecutor::completeListValue(GraphQLType: OnlineStoreThemeSetting, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(5), instance of Illuminate\\Support\\Collection(2))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 741, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStoreThemeSetting, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(5), instance of Illuminate\\Support\\Collection(2))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 654, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStoreThemeSetting, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(5), instance of Illuminate\\Support\\Collection(2))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 557, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValueCatchingError(GraphQLType: OnlineStoreThemeSetting, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(5), instance of Illuminate\\Support\\Collection(2))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 1195, "call": "GraphQL\\Executor\\ReferenceExecutor::resolveField(GraphQLType: OnlineStoreThemeSettingsCategory, array(3), instance of ArrayObject(1), array(5))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 1145, "call": "GraphQL\\Executor\\ReferenceExecutor::executeFields(GraphQLType: OnlineStoreThemeSettingsCategory, array(3), array(4), instance of ArrayObject(4))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 1106, "call": "GraphQL\\Executor\\ReferenceExecutor::collectAndExecuteSubfields(GraphQLType: OnlineStoreThemeSettingsCategory, instance of ArrayObject(1), array(4), array(3))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 793, "call": "GraphQL\\Executor\\ReferenceExecutor::completeObjectValue(GraphQLType: OnlineStoreThemeSettingsCategory, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(4), array(3))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 741, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStoreThemeSettingsCategory, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(4), array(3))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 654, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStoreThemeSettingsCategory, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(4), array(3))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 887, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValueCatchingError(GraphQLType: OnlineStoreThemeSettingsCategory, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(4), array(3))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 761, "call": "GraphQL\\Executor\\ReferenceExecutor::completeListValue(GraphQLType: OnlineStoreThemeSettingsCategory, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(3), instance of Illuminate\\Support\\Collection(10))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 741, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStoreThemeSettingsCategory, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(3), instance of Illuminate\\Support\\Collection(10))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 654, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStoreThemeSettingsCategory, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(3), instance of Illuminate\\Support\\Collection(10))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 557, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValueCatchingError(GraphQLType: OnlineStoreThemeSettingsCategory, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(3), instance of Illuminate\\Support\\Collection(10))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 1195, "call": "GraphQL\\Executor\\ReferenceExecutor::resolveField(GraphQLType: OnlineStoreTheme, array(11), instance of ArrayObject(1), array(3))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 1145, "call": "GraphQL\\Executor\\ReferenceExecutor::executeFields(GraphQLType: OnlineStoreTheme, array(11), array(2), instance of ArrayObject(12))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 1106, "call": "GraphQL\\Executor\\ReferenceExecutor::collectAndExecuteSubfields(GraphQLType: OnlineStoreTheme, instance of ArrayObject(1), array(2), array(11))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 793, "call": "GraphQL\\Executor\\ReferenceExecutor::completeObjectValue(GraphQLType: OnlineStoreTheme, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(2), array(11))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 654, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStoreTheme, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(2), array(11))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 557, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValueCatchingError(GraphQLType: OnlineStoreTheme, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(2), array(11))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 1195, "call": "GraphQL\\Executor\\ReferenceExecutor::resolveField(GraphQLType: OnlineStore, array(0), instance of ArrayObject(1), array(2))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 1145, "call": "GraphQL\\Executor\\ReferenceExecutor::executeFields(GraphQLType: OnlineStore, array(0), array(1), instance of ArrayObject(2))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 1106, "call": "GraphQL\\Executor\\ReferenceExecutor::collectAndExecuteSubfields(GraphQLType: OnlineStore, instance of ArrayObject(1), array(1), array(0))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 793, "call": "GraphQL\\Executor\\ReferenceExecutor::completeObjectValue(GraphQLType: OnlineStore, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), array(0))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 741, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStore, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), array(0))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 654, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValue(GraphQLType: OnlineStore, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), array(0))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 557, "call": "GraphQL\\Executor\\ReferenceExecutor::completeValueCatchingError(GraphQLType: OnlineStore, instance of ArrayObject(1), instance of GraphQL\\Type\\Definition\\ResolveInfo, array(1), array(0))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 1195, "call": "GraphQL\\Executor\\ReferenceExecutor::resolveField(GraphQLType: Query, null, instance of ArrayObject(1), array(1))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 264, "call": "GraphQL\\Executor\\ReferenceExecutor::executeFields(GraphQLType: Query, null, array(0), instance of ArrayObject(2))" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\ReferenceExecutor.php", "line": 215, "call": "GraphQL\\Executor\\ReferenceExecutor::executeOperation(instance of GraphQL\\Language\\AST\\OperationDefinitionNode, null)" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\Executor\\Executor.php", "line": 156, "call": "GraphQL\\Executor\\ReferenceExecutor::doExecute()" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\GraphQL.php", "line": 162, "call": "GraphQL\\Executor\\Executor::promiseToExecute(instance of GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter, instance of GraphQL\\Type\\Schema, instance of GraphQL\\Language\\AST\\DocumentNode, null, instance of Nuwave\\Lighthouse\\Schema\\Context, array(1), 'ThemeById', null)" }, { "file": "E:\\wwwroot\\object\\vendor\\webonyx\\graphql-php\\src\\GraphQL.php", "line": 94, "call": "GraphQL\\GraphQL::promiseToExecute(instance of GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter, instance of GraphQL\\Type\\Schema, instance of GraphQL\\Language\\AST\\DocumentNode, null, instance of Nuwave\\Lighthouse\\Schema\\Context, array(1), 'ThemeById', null, array(29))" }, { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\GraphQL.php", "line": 268, "call": "GraphQL\\GraphQL::executeQuery(instance of GraphQL\\Type\\Schema, instance of GraphQL\\Language\\AST\\DocumentNode, null, instance of Nuwave\\Lighthouse\\Schema\\Context, array(1), 'ThemeById', null, array(29))" }, { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\GraphQL.php", "line": 203, "call": "Nuwave\\Lighthouse\\GraphQL::executeParsedQuery(instance of GraphQL\\Language\\AST\\DocumentNode, instance of Nuwave\\Lighthouse\\Schema\\Context, array(1), null, 'ThemeById')" }, { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\GraphQL.php", "line": 162, "call": "Nuwave\\Lighthouse\\GraphQL::parseAndExecuteQuery('query ThemeById($themeId: ID!) {\n onlineStore {\n theme(id: $themeId) {\n id\n editable\n createdAt\n editedAt\n name\n role\n previewable\n url\n themeStoreThemeId\n metadata {\n author\n description\n documentationUrl\n logoUrl\n name\n supportEmail\n supportUrl\n version\n __typename\n }\n themeSettingsCategories {\n ...ThemeSettingsCategory\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n}\n\nfragment ThemeSettingsCategory on OnlineStoreThemeSettingsCategory {\n id\n title\n settings {\n ...ThemeSetting\n __typename\n }\n __typename\n}\n\nfragment ThemeSetting on OnlineStoreThemeSetting {\n ... on OnlineStoreThemeSettingHeader {\n ...ThemeSettingHeader\n __typename\n }\n ... on OnlineStoreThemeSettingCollection {\n ...ThemeSettingCollection\n __typename\n }\n ... on OnlineStoreThemeSettingColor {\n ...ThemeSettingColor\n __typename\n }\n ... on OnlineStoreThemeSettingFont {\n ...ThemeSettingFont\n __typename\n }\n ... on OnlineStoreThemeSettingImage {\n ...ThemeSettingImage\n __typename\n }\n ... on OnlineStoreThemeSettingImagePicker {\n ...ThemeSettingImagePicker\n __typename\n }\n ... on OnlineStoreThemeSettingRange {\n ...RangeSettingOse\n __typename\n }\n ... on OnlineStoreThemeSettingText {\n ...ThemeSettingText\n __typename\n }\n ... on OnlineStoreThemeSettingSelect {\n ...ThemeSettingSelect\n __typename\n }\n ... on OnlineStoreThemeSettingMultipleSelect {\n ...ThemeSettingMultipleSelect\n __typename\n }\n ... on OnlineStoreThemeSettingCheckbox {\n ...ThemeSettingCheckbox\n __typename\n }\n __typename\n}\n\nfragment ThemeSettingCommon on OnlineStoreThemeSetting {\n id\n info\n label\n settingId\n type\n __typename\n}\n\nfragment ThemeSettingHeader on OnlineStoreThemeSettingHeader {\n ...ThemeSettingCommon\n content\n __typename\n}\n\nfragment ThemeSettingCollection on OnlineStoreThemeSettingCollection {\n ...ThemeSettingCommon\n collectionValue: value\n __typename\n}\n\nfragment ThemeSettingColor on OnlineStoreThemeSettingColor {\n ...ThemeSettingCommon\n colorDefault: default\n colorValue: value\n __typename\n}\n\nfragment ThemeSettingFont on OnlineStoreThemeSettingFont {\n ...ThemeSettingCommon\n options {\n label\n value\n __typename\n }\n fontValue: value\n __typename\n}\n\nfragment ThemeSettingImage on OnlineStoreThemeSettingImage {\n ...ThemeSettingCommon\n imageValue: value\n __typename\n}\n\nfragment ThemeSettingImagePicker on OnlineStoreThemeSettingImagePicker {\n ...ThemeSettingCommon\n imagePickerValue: value\n __typename\n}\n\nfragment RangeSettingOse on OnlineStoreThemeSettingRange {\n ...ThemeSettingCommon\n rangeDefault: default\n min\n max\n step\n unit\n rangeValue: value\n __typename\n}\n\nfragment ThemeSettingText on OnlineStoreThemeSettingText {\n ...ThemeSettingCommon\n textDefault: default\n textValue: value\n placeholder: placeholder\n __typename\n}\n\nfragment ThemeSettingSelect on OnlineStoreThemeSettingSelect {\n ...ThemeSettingCommon\n selectDefault: default\n selectValue: value\n options {\n group\n label\n value\n __typename\n }\n __typename\n}\n\nfragment ThemeSettingMultipleSelect on OnlineStoreThemeSettingMultipleSelect {\n ...ThemeSettingCommon\n multipleSelectDefault: default\n multipleSelectValue: value\n options: options {\n group\n label\n value\n __typename\n }\n __typename\n}\n\nfragment ThemeSettingCheckbox on OnlineStoreThemeSettingCheckbox {\n ...ThemeSettingCommon\n checkboxDefault: default\n checkboxValue: value\n __typename\n}\n\n\n\n\n', instance of Nuwave\\Lighthouse\\Schema\\Context, array(1), null, 'ThemeById')" }, { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\GraphQL.php", "line": 121, "call": "Nuwave\\Lighthouse\\GraphQL::executeOperation(instance of GraphQL\\Server\\OperationParams, instance of Nuwave\\Lighthouse\\Schema\\Context)" }, { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\Support\\Utils.php", "line": 99, "call": "Nuwave\\Lighthouse\\GraphQL::Nuwave\\Lighthouse\\{closure}(instance of GraphQL\\Server\\OperationParams)" }, { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\GraphQL.php", "line": 120, "call": "Nuwave\\Lighthouse\\Support\\Utils::applyEach(instance of Closure, instance of GraphQL\\Server\\OperationParams)" }, { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\Support\\Http\\Controllers\\GraphQLController.php", "line": 32, "call": "Nuwave\\Lighthouse\\GraphQL::executeOperationOrOperations(instance of GraphQL\\Server\\OperationParams, instance of Nuwave\\Lighthouse\\Schema\\Context)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php", "line": 48, "call": "Nuwave\\Lighthouse\\Support\\Http\\Controllers\\GraphQLController::__invoke(instance of Illuminate\\Http\\Request, instance of Nuwave\\Lighthouse\\GraphQL, instance of Illuminate\\Events\\Dispatcher, instance of Laragraph\\Utils\\RequestParser, instance of Nuwave\\Lighthouse\\Execution\\SingleResponse, instance of Nuwave\\Lighthouse\\Execution\\ContextFactory)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php", "line": 219, "call": "Illuminate\\Routing\\ControllerDispatcher::dispatch(instance of Illuminate\\Routing\\Route, instance of Nuwave\\Lighthouse\\Support\\Http\\Controllers\\GraphQLController, '__invoke')" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php", "line": 176, "call": "Illuminate\\Routing\\Route::runController()" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 681, "call": "Illuminate\\Routing\\Route::run()" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 130, "call": "Illuminate\\Routing\\Router::Illuminate\\Routing\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\Support\\Http\\Middleware\\AttemptAuthentication.php", "line": 34, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "call": "Nuwave\\Lighthouse\\Support\\Http\\Middleware\\AttemptAuthentication::handle(instance of Illuminate\\Http\\Request, instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\nuwave\\lighthouse\\src\\Support\\Http\\Middleware\\AcceptJson.php", "line": 27, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "call": "Nuwave\\Lighthouse\\Support\\Http\\Middleware\\AcceptJson::handle(instance of Illuminate\\Http\\Request, instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 105, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 683, "call": "Illuminate\\Pipeline\\Pipeline::then(instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 658, "call": "Illuminate\\Routing\\Router::runRouteWithinStack(instance of Illuminate\\Routing\\Route, instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 624, "call": "Illuminate\\Routing\\Router::runRoute(instance of Illuminate\\Http\\Request, instance of Illuminate\\Routing\\Route)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php", "line": 613, "call": "Illuminate\\Routing\\Router::dispatchToRoute(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 170, "call": "Illuminate\\Routing\\Router::dispatch(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 130, "call": "Illuminate\\Foundation\\Http\\Kernel::Illuminate\\Foundation\\Http\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\app\\Http\\Middleware\\ChangeAppUrlMiddleware.php", "line": 23, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "call": "App\\Http\\Middleware\\ChangeAppUrlMiddleware::handle(instance of Illuminate\\Http\\Request, instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php", "line": 21, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "call": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest::handle(instance of Illuminate\\Http\\Request, instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php", "line": 21, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "call": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest::handle(instance of Illuminate\\Http\\Request, instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php", "line": 27, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "call": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize::handle(instance of Illuminate\\Http\\Request, instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode.php", "line": 63, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "call": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode::handle(instance of Illuminate\\Http\\Request, instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\fideloper\\proxy\\src\\TrustProxies.php", "line": 57, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "call": "Fideloper\\Proxy\\TrustProxies::handle(instance of Illuminate\\Http\\Request, instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\dingo\\api\\src\\Http\\Middleware\\Request.php", "line": 111, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 171, "call": "Dingo\\Api\\Http\\Middleware\\Request::handle(instance of Illuminate\\Http\\Request, instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php", "line": 105, "call": "Illuminate\\Pipeline\\Pipeline::Illuminate\\Pipeline\\{closure}(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 145, "call": "Illuminate\\Pipeline\\Pipeline::then(instance of Closure)" }, { "file": "E:\\wwwroot\\object\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php", "line": 110, "call": "Illuminate\\Foundation\\Http\\Kernel::sendRequestThroughRouter(instance of Illuminate\\Http\\Request)" }, { "file": "E:\\wwwroot\\object\\public\\index.php", "line": 57, "call": "Illuminate\\Foundation\\Http\\Kernel::handle(instance of Illuminate\\Http\\Request)" } ] } ], "data": { "onlineStore": { "theme": null, "__typename": "OnlineStore" }, "__typename": "Query" } }
2、打印待响应的数据,发现 [__typename] => ThemeSettingRange。如图2
Array ( [id] => Modules\OnlineStoreThemeGraphQL\Resolver\Id Object ( [prefixes:protected] => Array ( [0] => 96b1c8b9-5b18-4760-9e26-50ab009ac011 [1] => settings-categories [2] => %E9%A3%8E%E6%A0%BC ) ) [title] => 风格 [settings] => Illuminate\Support\Collection Object ( [items:protected] => Array ( [0] => Array ( [info] => [label] => 图片圆角度数 [type] => RANGE [default] => 0 [id] => Modules\OnlineStoreThemeGraphQL\Resolver\Id Object ( [prefixes:protected] => Array ( [0] => 96b1c8b9-5b18-4760-9e26-50ab009ac011 [1] => settings [2] => radius__image ) ) [min] => 0 [max] => 24 [step] => 1 [unit] => [__typename] => ThemeSettingRange [settingId] => radius__image [value] => 0 ) [1] => Array ( [info] => [label] => 按钮圆角度数 [type] => RANGE [default] => 0 [id] => Modules\OnlineStoreThemeGraphQL\Resolver\Id Object ( [prefixes:protected] => Array ( [0] => 96b1c8b9-5b18-4760-9e26-50ab009ac011 [1] => settings [2] => radius__button ) ) [min] => 0 [max] => 24 [step] => 1 [unit] => [__typename] => ThemeSettingRange [settingId] => radius__button [value] => 0 ) ) ) )
3、调整实现,添加 OnlineStore 前缀。不再报错。
return array_merge($type->toArray(), [ 'id' => $globalId, 'type' => $typeName, '__typename' => 'OnlineStoreThemeSetting'.$this->camelize($type->getType()), 'settingId' => $type instanceof IdentifiedType ? $type->getId() : $globalId, ]);
近期评论