crystal icon indicating copy to clipboard operation
crystal copied to clipboard

File Upload Support

Open chadfurman opened this issue 6 years ago • 3 comments

I'm submitting a ...

  • [ ] bug report
  • [X] feature request
  • [ ] question

PostGraphile version:

4.0.1


https://blog.apollographql.com/file-uploads-with-apollo-server-2-0-5db2f3f60675

There is a way to do file uploads in GraphQL and I don't see it in your docs or your github issues list

chadfurman avatar Jan 22 '19 14:01 chadfurman

@mattbretl has written a file uploads example here:

https://github.com/mattbretl/postgraphile-upload-example/blob/master/README.md

Where do you want to upload the file to? Are you intending to store it as BYTEA in the database?

In my own projects I upload files directly to Amazon S3 (using a signed URL generated by the GraphQL API) and then send the resulting URL to the GraphQL server when upload completes.

benjie avatar Jan 22 '19 15:01 benjie

Fair warning, that was one of the first plugins that I cobbled together.. I'd like to rewrite it using makeWrapResolversPlugin at some point.

mattbretl avatar Jan 22 '19 15:01 mattbretl

My personal plan was S3 storage also, so a plugin that takes in an ARN and posts the images there could be cool.

I will reference this example when I need this feature. Thank you, @mattbretl !

chadfurman avatar Jan 23 '19 03:01 chadfurman