I’ve spent a couple of days of trying to figure out how to upload a file through Monday’s SDK.
According to here: API v2 Documentation
It should be possible via Monday SDK client side, right? And yes, all of my permission scopes are checked.
I’ve tried:
const noVariableQuery = `mutation {add_file_to_update (update_id: ${update_id}, file: ${newFile}) {id}}`
//and
const queryWithVariable = `mutation addFile($file: File!) {add_file_to_update (update_id: ${update_id}, file: $file) {id}}`
monday.api(noVariableQuery)
//and
monday.api(queryWithVariable, {options: {variables: {file: newFile}}})
//and
monday.api(queryWithVariable,{options: {"variables[file]": newFile}})
All of those don’t work so I was wondering what did it require?
My original file was a Blob so I’ve converted it to a file and that didn’t work.
I decided to try the File Uploader settings and sent in response.data.fileUploader
in and that didn’t work either.
Well, that’s where I’m at right now and would love to get Monday SDK working for file upload. Other mutations and queries are working just fine. The GraphQL Playground of course doesn’t support file upload so testing is impossible.
Currently while I’m stuck with the client side, file upload for backend is working great. What I have working right now is I send my file to my backend server using Dipro’s code example for nodejs: Uploading a file to the monday.com API, from basics · GitHub . Works great Thanks! No issues there.
I just want to know if it’s possible to skip the backend requirement and just use Monday’s SDK.
Thanks in advance!