Skip to content

productReviewPhotoUpload

Mutationin Product review

A signed URL to upload one photo of a review to, which the buyer's browser PUTs the file to before naming its photoId in productReviewCreate. The contentType is an image type the shop takes.

Arguments

ArgumentTypeDescription
filenameString!
contentTypeString!

Returns

ProductReviewPhotoUploadResponse!

FieldTypeDescription
uploadProductReviewPhotoUpload
reviewErrors[ProductReviewPhotoUploadError!]Such as a content type the shop does not take, or a shop that takes no photos

Example

mutation ProductReviewPhotoUpload($filename: String!, $contentType: String!) {
productReviewPhotoUpload(filename: $filename, contentType: $contentType) {
upload {
photoId
uploadUrl
expiresAt
}
reviewErrors {
__typename
... on ValidationError {
message
}
}
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved

Used by

The storefront packages that send it, in these GraphQL documents: