
{
"errors": [
{
"message": "Validation failed for the field [onlineStoreThemeEditorSessionDelete].",
"extensions": {
"validation": {
"sessionId": [
"online_store_theme_graphql::validation.custom.theme_editor_session.theme_editor_session_id_exists_rule"
]
},
"category": "validation"
},
"locations": [
{
"line": 3,
"column": 3
}
],
"path": [
"onlineStoreThemeEditorSessionDelete"
],
"trace": ...
}
],
"data": {
"onlineStoreThemeEditorSessionDelete": null
}
}

{
"errors": [
{
"message": "Validation failed for the field [onlineStoreThemeEditorSessionDelete].",
"extensions": {
"validation": {
"sessionId": [
"The selected session id is invalid."
]
},
"category": "validation"
},
"locations": [
{
"line": 3,
"column": 3
}
],
"path": [
"onlineStoreThemeEditorSessionDelete"
],
"trace": ...
}
],
"data": {
"onlineStoreThemeEditorSessionDelete": null
}
}
class GraphQlResolverServiceProvider extends ServiceProvider implements DeferrableProvider
{
/**
* @return void
*/
public function register()
{
$this->registerTranslations();
// ...
}
}
class GraphQlResolverServiceProvider extends ServiceProvider implements DeferrableProvider
{
/**
* @return void
*/
public function register()
{
$this->registerLoader();
$this->app->singleton('translator', function ($app) {
$loader = $app['translation.loader'];
// When registering the translator component, we'll need to set the default
// locale as well as the fallback locale. So, we'll grab the application
// configuration so we can easily get both of these values from there.
$locale = $app['config']['app.locale'];
$trans = new Translator($loader, $locale);
$trans->setFallback($app['config']['app.fallback_locale']);
return $trans;
});
$this->registerTranslations();
// ...
}
/**
* Register the translation line loader.
*
* @return void
*/
protected function registerLoader()
{
$this->app->singleton('translation.loader', function ($app) {
return new FileLoader($app['files'], $app['path.lang']);
});
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
} else {
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', $this->moduleNameLower);
}
}
/**
* 获取由提供者提供的服务。
*
* @return array
*/
public function provides()
{
return ['translator', 'translation.loader'];
}
}
class OnlineStoreThemeGraphQLServiceProvider extends ServiceProvider
{
private $moduleNameLower = 'online_store_theme_graphql';
/**
* @return void
*/
public function register()
{
$this->app->register(ResolverServiceProvider::class);
$this->registerTranslations();
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
} else {
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', $this->moduleNameLower);
}
}
/**
* 获取由提供者提供的服务。
*
* @return array
*/
public function provides()
{
return [];
}
}
class ResolverServiceProvider extends ServiceProvider implements DeferrableProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->singleton(SettingPersistenceInterface::class, function($app){
return new DbSettingPersister();
});
$this->app->singleton(ThemeAssetRepositoryInterface::class, function($app){
return new ThemeAssetRepository();
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [SettingPersistenceInterface::class, ThemeAssetRepositoryInterface::class];
}
}

PHP / Laravel / Yii2 老项目维护与长期技术支持
如果你的 PHP / Laravel / Yii2 项目已经上线,但遇到原开发离职、Bug 长期无人修复、接口不稳定、性能下降、代码难以接手等问题,可以联系我做一次远程技术排查。
适合以下情况:
✅ 老旧 PHP 系统无人维护
✅ Laravel / Yii2 项目 Bug 修复
✅ 后台管理系统小功能迭代
✅ RESTful API 接口排查
✅ MySQL / Redis / Nginx 性能问题
✅ 长期远程兼职维护
可先从一次小问题开始:
✅ 线上报错排查
✅ 接口异常分析
✅ 慢查询与性能瓶颈定位
✅ 代码结构初步评估
✅ 部署环境与日志检查
如需咨询,请联系我,并注明:PHP 维护咨询。
联系方式:
Telegram:@shuijingwan
微信:13980074657
邮箱:shuijingwanwq@gmail.com

发表回复