stagedUploadTargetGenerate mutation
弃用警告
使用stagedUploadsCreate
替代
生成将资产上传到Shopify所需的URL和签名的参数。
在本页面
互动范例
这是一个示例变异查询。
mutation stagedUploadTargetGenerate($input: StagedUploadTargetGenerateInput!) { stagedUploadTargetGenerate(input: $input) {} } 变量: { “input”: {
<font style="color:#1F61A0;">parameters</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">name</font>
<font style="color:#1F61A0;">value</font>
<font style="color:#555555;">}</font>
<font style="color:#1F61A0;">url</font>
<font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">field</font>
<font style="color:#1F61A0;">message</font>
<font style="color:#555555;">}</font>
} }
<font style="color:#8B2BB9;">"resource"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">,</font>
<font style="color:#8B2BB9;">"filename"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font><font style="color:#555555;">,</font>
<font style="color:#8B2BB9;">"mimeType"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font>
参数
参数 | 描述 |
---|---|
input ( [StagedUploadTargetGenerateInput!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/stageduploadtargetgenerateinput) )必需的 |
用于生成分段上传的输入字段。 |
StagedUploadTargetGenerateInput字段
- fileSize(
[UnsignedInt64](https://shopify.dev/docs/admin-api/graphql/reference/scalar#unsignedint64-2021-01)
)
要上传的文件大小,以字节为单位。 - filename(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
) 必需的
要上传的资产的文件名。 - httpMethod(
[StagedUploadHttpMethodType](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/stageduploadhttpmethodtype)
)
分阶段上传将使用的HTTP方法。 - mimeType(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
) 必需的
上载资产的MIME类型。 - resource(
[StagedUploadTargetGenerateUploadResource!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/stageduploadtargetgenerateuploadresource)
) 必需的
正在上传的资源类型。
返回字段
- parameters(
[[MutationsStagedUploadTargetGenerateUploadParameter!]!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/mutationsstageduploadtargetgenerateuploadparameter)
)
可用于上传资产的已签名参数。 - url(
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
)
可以上传资产的签名URL。 - userErrors(
[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror)
)
执行mutation时发生的错误列表。