Reputation: 1291
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
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