graphlient icon indicating copy to clipboard operation
graphlient copied to clipboard

Add multipart request support

Open pucinsk opened this issue 5 years ago • 10 comments

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.

pucinsk avatar Oct 31 '19 11:10 pucinsk

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

dangerpr-bot avatar Oct 31 '19 11:10 dangerpr-bot

@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?

dblock avatar Nov 06 '19 13:11 dblock

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

pucinsk avatar Nov 07 '19 14:11 pucinsk

Thanks @pucinsk, yes that would be awesome to add support to existing adapter. Thanks so much!

ashkan18 avatar Nov 07 '19 14:11 ashkan18

Yes, 1 adapter > 2 adapters.

dblock avatar Nov 07 '19 20:11 dblock

Hi can you merge the branch? I would like to use this functionality

uiltonlopes avatar Jul 22 '22 23:07 uiltonlopes

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

uiltonlopes avatar Jul 23 '22 14:07 uiltonlopes

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.

dblock avatar Jul 23 '22 14:07 dblock

Hello guys, is there any way to send files with Graphlient, or only with this PR?

I don't know of one.

dblock avatar Dec 22 '23 19:12 dblock