graphql-python / graphql-python/flask-graphql

File Upload

未关闭
#33 7 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
1.3k
派生
139
PR 合并指标
30 天内没有已合并 PR

描述

I'm working on an [example repo](https://github.com/savovs/flask-graphene-hello) and was wondering, what would be the simplest way to implement that? This is what I tried without GraphQL:

```python
@app.route('/upload', methods=['POST'])
def uploadFile():
for key in request.files:
file = request.files[key]
file.save(os.path.join(UPLOAD_FOLDER, file.filename))

return 'uploaded'
```

[This is what](https://github.com/jaydenseric/apollo-upload-server) I used in Node.js, would love to do something like that for Flask in Python.

If it's not supported by flask-graphql I'd be happy to work on a pull request. Also, how would you test this without a browser, using Graphiql, Postman or something like that?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。