aws-mobile-appsync-sdk-ios
aws-mobile-appsync-sdk-ios copied to clipboard
Feature Request: uploading multiple S3 object within a mutation
Hi AppSync team,
It's a common use case that we would need to upload original media file along with thumbnail file.
Really hope we have this feature supported!
Thanks
Hello @Derek-X-Wang
Thanks for reporting this use-case. I will take this as a feature request to the team.
In the mean while, could you use some lambda trigger to create thumbnails once the customer uploads the complex objects? You can find the tutorial to do that here.
Thanks, Rohan
Hi @rohandubal,
Thanks for replying!
I had thought about that option in the beginning.
Since it's a mutation that will be used a lot, I would like to keep thumbnail generation locally to save some money.
I'm currently doing two mutations in sequence for uploading and it works.
But the thing just gets messier after we figure it out that we may need three complex objects.
It will be really awesome that the SDK will handle the S3 uploads.
Anyway, keep me updated on this.
Thanks, Derek
Thanks again for explaining your use-case. This helps us determine our future features. I will keep this thread updated if we have a solution to achieve this in a simple way using the SDK.
Thanks, Rohan
I came here because I just tried to do this, too! Specifically the thumbnail thing. I'll try the lambda solution for now and will watch this thread.
Thanks, guys!
I can get this worked with my folk: https://github.com/luannguyenkhoa/aws-mobile-appsync-sdk-ios
The only thing you need to implement is adding a func inside extension AWSS3TransferUtility: AWSS3ObjectManager{}
in API.swift file as below:
public func uploadFiles(s3Objects: [AWSS3InputObjectProtocol & AWSS3ObjectProtocol], completion: @escaping ((Bool, Error?) -> Void)) {}
that should performs a parallel file upload when getting invoked. All changes are included the latest commit, very appreciated if you guys can take a look and leave some ideas.
@palpatim, @rohandubal - Is there any movement on this feature implementation? We'd also like the option to upload multiple S3 object types within a single mutation.
Hello all,
Do we have any update on this issue?
I'm using AWSAppSync 3.0.0
but seems no way to upload more than one s3 object in the same mutation.
input CreateMessageInput {
id: ID
messageContent: [S3ObjectInput] -> Unable to upload
}
input CreateMessageInput {
id: ID
messageContent: S3ObjectInput -> Work fine
}
@luannguyenkhoa did you able to handle this issue? Thanks
Hi,
I'm also curious about the status of this. I'm planning to write a schema with a model that will have an array of photos and am hoping to use the built in s3 support
thanks!
They've said they're aware of the feature request. As others have pointed out, it really just comes down to adding a method or two to the existing code. A while back, I also made a fork that worked for my purposes. [UPDATE] I updated the code for AWSAppSync 3.1.3. Still works for me.
Fork's diff page showing methods
It just recursively parses out the multiple S3Objects from their GraphQLMapConvertible structs... Again, works for me . Maybe it'll at least help point you in the right direction until official SDK support.
Hi,
Just wanted to see if there is an update/timeline on this issue? We are also planning on using a schema with multiple s3 objects and it would be awesome to have SDK support for this.
Thanks!
Hi,
It has been over 3 years, what is the status on this? Are there any recommendations/other approaches?
Thanks.
@jonathanarevalogaray I ended up using RxSwift to handle this issue, basically, I've used zip to merge multiple uploading requests then subscript for the result when all of them are finished.
Thank you for opening this issue. AWS AppSync SDK for iOS entered maintenance mode in September 2023 and will receive no further updates as of September 2024.
Please use Amplify Swift going forward. For information on upgrading to Amplify Swift, refer to the Upgrade from AppSync SDK documentation.