Skip to main content

Upload Images

First you need to use createImages query to get the image url, and then you have to upload your image to that url.

mutation {
createImages(input: [{contentType: "image/jpg"}]) {
fields
mediaDownloadUrl
mediaId
mediaUrl
signedUrl
}
}

Our javascript client have a function to automatically create and upload the images for you. It takes an extra File object as an argument.

client.media.uploadImages([{ contentType: 'image/jpg', file: file }])