apollo-upload-network-interface
apollo-upload-network-interface copied to clipboard
Initial work on File and Array<File> support
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.
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.