-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uploading files with Multer #301
Comments
Have you seen this? https://github.com/jangerhofer/apolloFileUpload/blob/master/server/main.js Also, are you using apollo-client? If you are, have a look at this issue. Scott |
Thanks @smolinari. Note in the code that I would like to use Multer inside GraphQL resolve functions, not using a single endpoint or middleware before calling Thanks for the issue! I did not know about it. |
@jferrettiboke did you get it to work in the end? |
Hi @jaydenseric. No, yet. Do you have some ideas? |
Yea, I'll try to get everything working and publish it sometime soon. |
Closing this for lack of activity. Let's keep track of file upload related things in #229. If anyone has time to write up and propose a design, I'd be more than happy to review it. Any and all contributions, big or small are welcome! |
For an immediate solution, checkout apollo-upload-server. |
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Hi everyone!
I am trying to uploading files with Multer through GraphQL. There are two ways to go.
For the first approach any file can be uploaded using
.any()
(Multer), which is fast but it is not possible to make specific validation rules for each GraphQL resource.For the second approach is totally valid make validation rules, which is more flexible.
Once explained this, I am interested to achieve the second approach. I think it is almost done but I am getting errors.
Test output.
I am getting this error because the server is not returning text in the response.
res.text
is undefined onexpect(JSON.parse(res.text)).to.deep.equal(...)
.Server output.
You can see and check the repository here. Feel free to send a PR or create a issue there.
Maybe something related with Apollo Server? Any thoughts on this?
Thanks in advance.
The text was updated successfully, but these errors were encountered: