markhuot/craftql

Mutation: upload file directly from browser

nelhop opened this issue · 0 comments

Is there a way to upload an image directly from the Browser, without loading it to a public server before?

Already working:

mutation uploadImage ( $image: [FotoAssetInput] ) {
  upsertXYZ ( image: $image ) {
    id
  }
}
{
  "image": [{"url": "https://placekitten.com/g/200/300"}]
}

Seeked feature:

{
  "image": [{"file": "File Object"}],
  "image": [{"base64": "data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAABZwAAAF..."}],
}