1. In a GraphQL Mutation, only one Mutation is currently executed within a single HTTP request. See Figure 1.

GraphQL
mutation UploadThemeAsset($input: ThemeAssetUploadInput!) {
onlineStoreThemeAssetUpload(input: $input) {
themeAsset {
id
themeId
value
key
publicUrl
mimeType
checksum
category
warnings
createdAt
updatable
deletable
renameable
updatable
}
}
}
JSON
{
"input": {
"themeId": "{{themeId}}",
"key": "assets/js/1.js",
"value": "string"
}
}
JSON
{
"data": {
"onlineStoreThemeAssetUpload": {
"themeAsset": {
"id": "346186",
"themeId": "98ad1110-014d-4a61-bbb4-d74bc4ed30f7",
"value": "string",
"key": "assets/js/1.js",
"publicUrl": null,
"mimeType": "text/plain",
"checksum": "ecb252044b5ea0f679ee78ec1a12904739e2904d",
"category": "asset",
"warnings": [],
"createdAt": "2023-03-14 17:36:36",
"updatable": false,
"deletable": false,
"renameable": false
}
}
}
}
2. When the number of HTTP requests per unit of time is too high, it triggers API rate limiting. See Figure 2.

3. The plan is to execute multiple Mutations within a single HTTP request. Reference: https://graphql.cn/learn/queries/#aliases , using aliases. See Figure 3.

GraphQL
mutation UploadThemeAsset($input1: ThemeAssetUploadInput!, $input2: ThemeAssetUploadInput!) {
themeAssetUpload1: onlineStoreThemeAssetUpload(input: $input1) {
themeAsset {
...themeAssetFields
}
}
themeAssetUpload2: onlineStoreThemeAssetUpload(input: $input2) {
themeAsset {
...themeAssetFields
}
}
}
fragment themeAssetFields on ThemeAsset {
id
themeId
value
key
publicUrl
mimeType
checksum
category
warnings
createdAt
updatable
deletable
renameable
updatable
}
JSON
{
"input1": {
"themeId": "{{themeId}}",
"key": "assets/js/1.js",
"value": "string"
},
"input2": {
"themeId": "{{themeId}}",
"key": "assets/js/2.js",
"value": "string"
}
}
JSON
{
"data": {
"themeAssetUpload1": {
"themeAsset": {
"id": "346186",
"themeId": "98ad1110-014d-4a61-bbb4-d74bc4ed30f7",
"value": "string",
"key": "assets/js/1.js",
"publicUrl": null,
"mimeType": "text/plain",
"checksum": "ecb252044b5ea0f679ee78ec1a12904739e2904d",
"category": "asset",
"warnings": [],
"createdAt": "2023-03-14 17:36:36",
"updatable": false,
"deletable": false,
"renameable": false
}
},
"themeAssetUpload2": {
"themeAsset": {
"id": "346187",
"themeId": "98ad1110-014d-4a61-bbb4-d74bc4ed30f7",
"value": "string",
"key": "assets/js/2.js",
"publicUrl": null,
"mimeType": "text/plain",
"checksum": "ecb252044b5ea0f679ee78ec1a12904739e2904d",
"category": "asset",
"warnings": [],
"createdAt": "2023-03-14 18:04:55",
"updatable": false,
"deletable": false,
"renameable": false
}
}
}
}
