Issue uploading files using Graphql / Altair Client

Viewed 650

I'm using the Altair Client to test some file uploads via Graphql. If I write out my query, and leave the variables blank, I get back an error response

Mutation:

mutation UploadCSV($fileData: Upload!) {
  uploadCsv(fileData: $fileData) {
    message
    errors
    successCount
  }
}

Errors:

"message": "In argument \"fileData\": Expected type \"Upload!\", found null."
"message": "Variable \"fileData\": Expected non-null, found null."

This is exactly what I'd expect, because I haven't attached a file yet. So I follow the Altair instructions and pick a file, and give it the name fileData. Now when I click Send Request, I get the error "message": "No query document supplied", which is the error you get when no query/mutation has been sent. What am I doing wrong here?

Here's an image of my workspace

0 Answers
Related