Support Hapi
See original GitHub issueHi!
As you may know Hapi has built in parsing of multipart requests and there are currently some issues with combining graphql-upload with that. If you want more background, check out this PR against apollo-server-hapi https://github.com/apollographql/apollo-server/pull/4943
The nicest way to integrate Hapi would be to let Hapi parse the request and provide an API from graphql-upload to handle that case, which you also describe in this old comment https://github.com/jaydenseric/graphql-upload/issues/5#issuecomment-309706215
In this comment https://github.com/apollographql/apollo-server/pull/4943#issuecomment-796738593 in the above PR you can see how I do this with Hapi, but with a lot of copy and paste from processRequest
. Are you interested to further explore an API that could be exported for Hapi users as well used internally by processRequest
to avoid this duplication?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Thank you for your answer!
Interesting about the sync and async case. Hapi does have (and I use) and option to stream the files but I get a list of them immediately so when thinking about it it’s probably using the sync thing anyway (except for possibly the last file). I’ll investigate this further. Now I understand some questions I previously had about the code 😃
I absolutely understand your side, please do not feel pressured engage in this. I have solved “my” problem and is enjoying graphql-upload both now with Hapi and, in earlier projects with Express so I’m already grateful, thank you! My first plan is introducing a layer to make external integration easier so that it could be summed up in a Medium or SO post but maybe not provide a fully supported integration. Unfortunately I can not commit to maintaining one at this point as any Node development is up for question in an effort to improve my own mental health. I’ll only submit a PR if think it would not be a burden on the project.
this was fixed once in here https://github.com/apollographql/apollo-server/pull/3268 but never went upstream. Is it safe to say we can neglect graphql-upload if hapi is used and better just go with identified upload requests instead?