简体   繁体   English

“必须提供查询字符串。” 石墨烯-蟒蛇

[英]“Must provide query string.” graphene-python

i try to send a file as following in Altair tool to graphql (backend is graphene-python).我尝试在Altair工具中将如下文件发送到 graphql (后端是石墨烯-python)。 I use this library for backend将此库用于后端在此处输入图像描述

but every it raises this error: Must provide query string .但它每次都会引发这个错误: Must provide query string how can I upload a file to graphql?如何将文件上传到 graphql?

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)附加的文件可能无效(额外的验证已添加到 Altair 以通知您这一点)
  • 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)服务器可能无法识别多部分请求,并且可能仍期待 JSON,这在这种情况下不起作用(因为文件上传要求请求使用多部分规范)

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.要验证问题所在,您可以通过查看 Altair 中开发人员工具的网络选项卡来验证从 Altair 发送的数据是否正确,并检查服务器是否已正确配置为使用多部分格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM