Closed danieljarrett74 closed 1 year ago
Got the same question...
Currently, this library only supports JSON payloads, which means the standard file upload implementation won't work.
File uploads via GraphQL are generally discouraged. The preferred pattern is to utilize an out-of-band upload system like an S3 pre-signed upload link. You can read about that here. Lambda also has a relatively small upload limit, 6MB in base64 (so less in practice), which means even some photos will have trouble uploading.
The functionality of GraphQL upload's graphqlUploadExpress
function could be reproduced as a middleware to this library, but I recommend using the solution outlined above with S3. The other option is to create a custom Buffer
scalar that accepts a base64 payload from the client and transforms it to a NodeJS buffer on the server. This would allow for small uploads to work without graphql-upload
and without stepping out of the application/json
content type.
Closing as won't fix unless there is a good reason to implement it otherwise. Given the general advice to not do upload handling in GraphQL, any implementation right now should utilize a middleware to catch and handle such requests.
Just wondering if there's any support for file uploads for Lambda. there doesn't appear to be any documentation on this.