graphlient
graphlient copied to clipboard
Add multipart request support
This PR allows send files via graphql. It adds FaradayMultipartAdapter
to allow send multipart requests via graphlient gem.
It accepts File
instances and convert its to Faraday::UploadIO
before sending.
1 Warning | |
---|---|
:warning: | Unless you’re refactoring existing code, please update CHANGELOG.md. |
Here's an example of a CHANGELOG.md entry:
* [#65](https://github.com/ashkan18/graphlient/pull/65): Add multipart request support - [@pucinsk](https://github.com/pucinsk).
Generated by :no_entry_sign: Danger
@pucinsk My biggest reservation about this PR is the creation of another adapter. Can we build multipart support into the existing one? What's the downside?
There are no downsides. I thought that it could be optional adapter.
But if it would be better that files supporting would be enabled by default than I am more than willing to add this to main FaradayAdapter
Thanks @pucinsk, yes that would be awesome to add support to existing adapter. Thanks so much!
Yes, 1 adapter > 2 adapters.
Hi can you merge the branch? I would like to use this functionality
This is pretty cool, but it seems strange to me that you would have to use a different adapter to send a file. Shouldn't I be able to do that by default?
Alright master. Can you help me with some file upload example that still manages to leverage the gem
This is pretty cool, but it seems strange to me that you would have to use a different adapter to send a file. Shouldn't I be able to do that by default?
Alright master. Can you help me with some file upload example that still manages to leverage the gem
I've never done that myself, so don't know how to do it with the current implementation. If you want to try and refactor this PR to support multipart I can try to help out fix any remaining issues on something that (almost) works.
Hello guys, is there any way to send files with Graphlient, or only with this PR?
I don't know of one.