0

I have the following use case:

I have an Apollo compatible file (form-multipart) GraphQL resolver for handling files (in the backend). The React App is using the Relay client.

How can I make an upload mutation using the Relay client?

The app is already using the latest Relay (v4.0).

I would like to avoid:

  • setting up Apollo client in the app (just to make the file upload)
  • fall back to REST and separate one request into two (graphql mutation + REST file upload).
Robert Zaremba
  • 8,081
  • 7
  • 47
  • 78
  • Did you end up resolving this? I am having a similar problem – JSilv Jul 30 '19 at 20:56
  • Unfortunately not yet – Robert Zaremba Aug 05 '19 at 03:43
  • I have a pretty good idea which direction I"m going to go, it's not in my current work sprint but will be in a few weeks / up to a month. For now, some links that are helping me out in the right direction: [upload scalar](https://github.com/jaydenseric/apollo-upload-examples/issues/9#issuecomment-433795841), [example with manual schema setting](https://github.com/jaydenseric/graphql-upload#examples). i think you'd use [this](https://madeintandem.com/blog/uploading-files-relay-modern/) but put the files right in the inputs instead. maybe. too complicated to try on ours without 5+ hours of work – JSilv Aug 05 '19 at 18:00

0 Answers0