Sarkis Arutiunian
Sarkis Arutiunian

Reputation: 1291

GraphQL js file uploading

I saw some example for Relay but I use graphQL with Apollo and can't find any example or documentation how to handle file uploading in GraphQL through mutation?

Upvotes: 1

Views: 1456

Answers (1)

helfer
helfer

Reputation: 7182

Apollo client doesn't support file uploads at the moment. Just as with authentication, it might be better to handle file uploads outside of GraphQL (at least for the time being).

That's why I would recommend uploading the file through a separate endpoint (i.e. a /uploads route in express, or directly to S3, etc.) and then calling a mutation with the file info when the upload has successfully completed.

Upvotes: 1

Related Questions