stagedUploadTargetsGenerate mutation
Deprecation warning
Use stagedUploadsCreate
instead
Uploads multiple images.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
mutation stagedUploadTargetsGenerate($input: [StageImageInput!]!) { stagedUploadTargetsGenerate(input: $input) {} } { “input”: [
<font style="color:#1F61A0;">urls</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">url</font>
<font style="color:#555555;">}</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:#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>
<font style="color:#555555;">}</font>
Arguments
Argument | Description |
---|---|
input ( [[StageImageInput!]!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/stageimageinput) ) REQUIRED |
The input fields for generating staged uploads. |
StageImageInput fields
- filename (
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
) REQUIRED
Image filename. - httpMethod (
[StagedUploadHttpMethodType](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/stageduploadhttpmethodtype)
)
HTTP method to be used by the Staged Upload. - mimeType (
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)
) REQUIRED
Image MIME type. - resource (
[StagedUploadTargetGenerateUploadResource!](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/stageduploadtargetgenerateuploadresource)
) REQUIRED
Image resource.
Return fields
- urls (
[[StagedUploadTarget!]](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/stageduploadtarget)
)
The staged upload targets that were generated. - userErrors (
[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror)
)
List of errors that occurred executing the mutation.