Category: GraphQL
-
Post Views: 20 1. In Lighthouse 5, an error is reported: illuminate\contracts\container\bindingResolutionException : target[Interface]Is not instantiable while building[Resolver]… as shown in Figure 1 2. Edit ThemeStoreGraphQL/Resources/GraphQL/Theme_Setting.GraphQL , comment out: TemplateSettingsData(BaseName: String!):[ThemeSection]@field(resolver: “modules\\themestoreGraphQL\\resolver\\onlinestoreetheme\\TemplateSettingsDataResolver”). Then no errors will be reported. 3. After uncommenting, check ThemeStoreGraphQL/Resolver/OnlineStoreEtheme/TemplateSettingsDateResolver.php . TemplateSchemaLoaderInterface is passed as a parameter to the constructor. 4. Check the service provider class of…
-
Post Views: 21 1. In Lighthouse 5, an error is reported: Failed to find class Modules\\ThemeStore\\Validators\\ThemeAsset\\CreateTheMeAssetInputValidator in namespaces[App\\GraphQL\\Validators]for directive @Validator. as shown in Figure 1 2. Confirm that the class Modules\\TheMeStore\\Validators\\ThemeAsset\\CreateTheMeAssetInputValidator has been migrated to Modules\\ThemeStoreGraphQL\\Validators\\ThemeAsset\\CreateTheMeAssetInputValidator . as shown in Figure 2 3. In the instruction @Validator After the class file path is adjusted to: Modules\\ThemeStoreGraphQL\\Validators\\ThemeAsset\\CreateTheMeAssetInputValidator, no more errors are…
-
Post Views: 15 1. Lighthouse uses a lot of SDL and uses mode instructions. In order to improve your editing experience, you can use the artisan command to generate a definition file. Error: Illuminate\Contracts\Container\BindingResolutionException : target[Modules\ThemeStore\View\ViewStorageInterface]Is not instantiable while building[Modules\ThemeStore\Resolver\OnlineStoreThemeResolver]. as shown in Figure 1 2. Execute the command: php artisan module:list to display a list of all modules. Confirm…
-
Post Views: 16 1. Error: Argument 1 Passed to App\\Exceptions\\Handler::report() must be an instance of exception, instance of typeError given, called in E:\WWRoot\\Object\Vendor\\nuwave\Lighthouse\src\execution\\reportingErrorHandler.php on line 40. as shown in Figure 1 2. Reference URL:https://www.shuijingwanwq.com/en/2022/01/26/9945/. Caused by version compatibility issues. Edit /vendor/nuwave/lighthouse/src/execution/reportingErrorHandler.php. Print $error. Message: Argument 1 Passed to Nuwave\Lighthouse\Schema\TypeRegistry::get() must be of the type string, array given, Called in E:\WwWroot\Object\Vendor\NuWave\Lighthouse\src\Schema\Typeregistry.php…
-
Post Views: 17 1. When the language area is en , when the validated parameter does not exist, the response: The selected theme ID is invalid. as shown in Figure 1 2. When the language area is zh_cn, when the validated parameter does not exist, the response: the selected Theme ID is invalid. Expected: The selected theme ID is invalid.…
-
Post Views: 17 1. In the program implementation, first request the API to generate a cache ID. Then request the API, delete the cache ID. as shown in Figure 1 2. If you want to pass in the test, the premise is that there must be a clear cache ID to delete the parameters of the request. 3. Reference URL:https://learnku.com/laravel/t/22690.…
-
Post Views: 18 1. At this stage, you need to implement an interface to delete the cache ID in the GraphQL API. Refer to the Shopify example. When the cache ID does not exist, the response fails. as shown in Figure 1 2. Due to the rule to verify whether this cache ID exists, it will be used in a…
-
Post Views: 20 1. In Laravel 6.20.43, Lighthouse 5.45.0, the classClearSschemaCacheDeprecated. as shown in Figure 1 2. The reason should be caused by the change of the version of the lighthouse. genusClearSschemaCacheThe effect is to clear the pattern cache before running any tests. 3. Reference:https://lighthouse-php.com/5/testing/phpunit.html#setup, decide to replace with the classRefressschemaCache 4. Edit /modules/themestore/tests/functional/graphql/themeAssetGraphqlaptest.php. as shown in Figure 2 5.…
-
Post Views: 22 1. The structure when the request responds successfully. as shown in Figure 1 2. However, at this stage, there is no security verification for the request parameters. Reference:https://lighthouse-php.com/master/security/validation.html#single-arguments. Lighthouse allows you to use Laravel’s validation in queries and changes. 3. The change of this GraphQL API has only one request parameter, that is, themeID, and only need…