apollo-upload-network-interface icon indicating copy to clipboard operation
apollo-upload-network-interface copied to clipboard

Initial work on File and Array<File> support

Open sandervanhooft opened this issue 8 years ago • 1 comments

Also see issue #3. My initial work on this. Got the checking to work, but adding the array to the request body fails. I've not tested appending only a File to the body.

sandervanhooft avatar Dec 07 '16 11:12 sandervanhooft

Hmmm ... can we detect variable type from mutation? For example ...

const ADD_PROFILE_PICTURE = gql`
  mutation addProfilePicture($id: Int!, $file: UploadedFile!) {
    addProfilePicture(id: $id, file: $file) {
      id type filename url
    }
  }`

or

const ADD_GALLERY_PICTURES = gql`
  mutation addGalleryPictures($id: Int!, $files: [UploadedFile!]!) {
    addGalleryPictures(id: $id, files: $files) {
      id type filename url
    }
  }`

But we still need to check for File or FileList somehow ... ahh too late, need to get some sleep. Let's discuss this tomorrow.

HriBB avatar Dec 07 '16 23:12 HriBB