Skip to main content

uploadUOMImage

Requires permission products:product:update.

Get a pre-signed URL for uploading a unit's icon image. Allowed types are JPEG, PNG, GIF and WEBP. Needs the products update permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation UploadUOMImage($data: UploadUOMImageInput!) {
uploadUOMImage(data: $data) {
key
publicUrl
uploadUrl
}
}

Variables:

{
"data": {
"contentType": "string",
"filename": "string",
"uomId": "string"
}
}

Response:

{
"data": {
"uploadUOMImage": {
"key": "string",
"publicUrl": "string",
"uploadUrl": "string"
}
}
}
uploadUOMImage(
data: UploadUOMImageInput!
): UploadUOMImageResult!

Arguments​

uploadUOMImage.data ● UploadUOMImageInput! non-null input​

The unit and the file to upload.

Type​

UploadUOMImageResult object​

The pre-signed upload URL for a unit's icon, the URL the image will be served from, and its storage key.