Skip to main content

Hi,


how to upload files to graphQL and use it to query monday to add file to an update?


query example:


mutation ($file: File!) {

add_file_to_update(update_id: 1212121, file: $file) {

id

}

}

.


how to pass a file to that variable name ‘file’. And what is the format of that file should be?

Hey @Proficient - welcome to the community!


This would vary a bit on where / how you’re trying to upload the file from. We support uploading any file that the file column supports on monday, as long as it’s uploaded as a multi-part file.


The easiest way to see this would be through Postman, as you can choose a file to upload and Postman will take care of the rest. You can see an example of it in the post below:



You can also use something like cURL to accomplish this:


--form 'query=mutation ($file: File!) { 
add_file_to_update (file: $file, update_id: xxxx) {id}}' \\
--form 'variables'file]=@/Users/danny/Downloads/big-image.png'

Hope this helps!


-Daniel



Thank you, it helped