
mutation DeleteThemeSessionId($sessionId: String!) {
onlineStoreEditorSessionDelete(sessionId: $sessionId) {
deletedSessionId
userErrors {
field
message
__typename
}
__typename
}
}
{
"sessionId": "H9Mc8FwH5Eu5LR37XAzsehh4"
}
{
"data": {
"onlineStoreEditorSessionDelete": {
"deletedSessionId": null,
"userErrors": [
{
"field": [
"sessionId"
],
"message": "在线商店编辑器访问不存在",
"__typename": "UserError"
}
],
"__typename": "OnlineStoreEditorSessionDeletePayload"
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 990,
"restoreRate": 50
}
}
}
}
<pre class="wp-block-syntaxhighlighter-code">
PS E:\wwwroot\object> php artisan help module:make-rule
Description:
Create a new validation rule for the specified module.
Usage:
module:make-rule <name> [<module>]
Arguments:
name The name of the rule class.
module The name of module will be used.
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
PS E:\wwwroot\object> php artisan module:make-rule ThemeEditor/ThemeEditorCodeExistsRule ThemeStore
Created : E:/wwwroot/object/Modules/ThemeStore/Rules/ThemeEditor/ThemeEditorCodeExistsRule.php
PS E:\wwwroot\object>
</pre>
<pre class="wp-block-syntaxhighlighter-code">
<?php
namespace Modules\ThemeStore\Rules\ThemeEditor;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Facades\Cache;
use Modules\ThemeStore\Resolver\ThemeEditor\ThemeEditorResolver;
class ThemeEditorCodeExistsRule implements Rule
{
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
return Cache::tags([ThemeEditorResolver::TAG_THEME_EDITOR, ThemeEditorResolver::TAG_THEME_EDITOR_CODE])->has($value);
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return 'The validation error message.';
}
}
</pre>
extend type Mutation {
...
"删除主题编辑标识"
onlineStoreThemeEditorCodeDelete(themeEditorCode: String! @rules(apply: ["Modules\\ThemeStore\\Rules\\ThemeEditor\\ThemeEditorCodeExistsRule"])): ThemeEditorCodeDeletePayload @field(resolver: "Modules\\ThemeStore\\Resolver\\ThemeEditor\\DeleteThemeEditorCodeResolver")
}
type ThemeEditorCodeDeletePayload
{
deletedThemeEditorCode: String
}
mutation {
onlineStoreThemeEditorCodeDelete(themeEditorCode: "vRYbn7NQiEWMbH2G6sXB8AE4aoBIk4JQOw2p0") {
deletedThemeEditorCode
}
}
{
"errors": [
{
"message": "Validation failed for the field [onlineStoreThemeEditorCodeDelete].",
"extensions": {
"validation": {
"themeEditorCode": [
"The validation error message."
]
},
"category": "validation"
},
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"onlineStoreThemeEditorCodeDelete"
],
"trace": [
...
]
}
],
"data": {
"onlineStoreThemeEditorCodeDelete": null
}
}
<pre class="wp-block-syntaxhighlighter-code">
<?php
return [
'custom' => [
'theme_editor_code' => [
'theme_editor_code_exists_rule' => 'The selected :attribute is invalid.',
],
],
'attributes' => [],
];
</pre>
<pre class="wp-block-syntaxhighlighter-code">
<?php
namespace Modules\ThemeStore\Rules\ThemeEditor;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Facades\Cache;
use Modules\ThemeStore\Resolver\ThemeEditor\ThemeEditorResolver;
class ThemeEditorCodeExistsRule implements Rule
{
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
return Cache::tags([ThemeEditorResolver::TAG_THEME_EDITOR, ThemeEditorResolver::TAG_THEME_EDITOR_CODE])->has($value);
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return trans('theme_store::validation.custom.theme_editor_code.theme_editor_code_exists_rule');
}
}
</pre>

mutation {
onlineStoreThemeEditorCodeDelete(themeEditorCode: "vRYbn7NQiEWMbH2G6sXB8AE4aoBIk4JQOw2p0") {
deletedThemeEditorCode
}
}
{
"errors": [
{
"message": "Validation failed for the field [onlineStoreThemeEditorCodeDelete].",
"extensions": {
"validation": {
"themeEditorCode": [
"The selected theme editor code is invalid."
]
},
"category": "validation"
},
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"onlineStoreThemeEditorCodeDelete"
],
"trace": [
...
]
}
],
"data": {
"onlineStoreThemeEditorCodeDelete": null
}
}
<pre class="wp-block-syntaxhighlighter-code">
<?php
return [
'custom' => [
'theme_editor_code' => [
'theme_editor_code_exists_rule' => '所选的主题编辑标识无效。',
],
],
'attributes' => [],
];
</pre>

{
"errors": [
{
"message": "Validation failed for the field [onlineStoreThemeEditorCodeDelete].",
"extensions": {
"validation": {
"themeEditorCode": [
"所选的主题编辑标识无效。"
]
},
"category": "validation"
},
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"onlineStoreThemeEditorCodeDelete"
],
"trace": [
...
]
}
],
"data": {
"onlineStoreThemeEditorCodeDelete": null
}
}
<pre class="wp-block-syntaxhighlighter-code">
<?php
return [
'custom' => [],
'attributes' => [],
];
</pre>
{
"errors": [
{
"message": "Validation failed for the field [onlineStoreThemeEditorCodeDelete].",
"extensions": {
"validation": {
"themeEditorCode": [
"The selected theme editor code is invalid."
]
},
"category": "validation"
},
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"onlineStoreThemeEditorCodeDelete"
],
"trace": ...
}
],
"data": {
"onlineStoreThemeEditorCodeDelete": null
}
}
private $moduleNameLower = 'theme_store';

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

发表回复