amplify-swift
amplify-swift copied to clipboard
How to upload S3Object with GraphQL API
Is there presently anyway to upload an image to be saved in my S3 bucket with the graphQL mutation or do I still have to do this separately?
I would like to use the S3Object type in my GraphQL api:
type S3Object {
bucket: String!
region: String!
key: String!
mimeType: String!
localUri: String!
}
However this is not working. Currently I have to do the API mutation and then Amplify.Storage.uploadData. Aside from adding an additional layer of complexity for syncing operations, the uploadData for amplify is painfully slow with no option for accelerated data transfer in the amplify library.
Can somebody please let me what is the best way to upload an image with an api mutation. The use case is sending a message in a chat application with an image. I need the API mutation for the message and to store the image on the S3 bucket. I don't want to have to do this as two separate parts. I know without the amplify library I can do this, but how can I do it using amplify?