1

i try to send a file as following in Altair tool to graphql (backend is graphene-python). I use this library for backend enter image description here

but every it raises this error: Must provide query string. how can I upload a file to graphql?

joelostblom
  • 43,590
  • 17
  • 150
  • 159
msln
  • 1,318
  • 2
  • 19
  • 38

1 Answers1

0

There are a couple of things that could be the culprit here:

  • The file attached might not be valid (Extra validations have been added to Altair to inform you about this)
  • The server might not recognize the multipart request, and might still be expecting JSON, which wouldn't work in this case (since the file upload requires the request to be using the multipart specification)

To verify what the issue is, you can verify that the right data is being sent from Altair by looking at the network tab of the developer tools in Altair, and also checking that the server is properly configured to work with the multipart format.

Samuel Imolorhe
  • 664
  • 4
  • 10