Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling file uploads? #58

Open
isocra opened this issue Jul 2, 2020 · 2 comments
Open

Handling file uploads? #58

isocra opened this issue Jul 2, 2020 · 2 comments

Comments

@isocra
Copy link

isocra commented Jul 2, 2020

Hi,

I know this isn't really an issue with your excellent packages, but I'm stuck. I have an app used by engineers to take photos of a work site. They're often offline. I used to use the AWS AppSync SDK which had a feature that would transparently upload photos to S3. Unfortunately they're not maintaining it now and it doesn't work with the latest React Native, Apollo or Expo, so hunting around I found these packages which work really well.

Unfortunately I can't find a way to handle images though. I tried turning the image into Base64 and then setting a property. This works OK as long as the image isn't very big. But I soon got errors from our AppSync server with medium-sized photos. I also got problems on the device saying the data was too large for the cache.

I've just been looking at Expo SDK38's new FileSystem.uploadAsync. This looks very neat because it works in the background, but I can't make it work with Android, only iOS so far and I'm not sure how to integrate it with GraphQL.

Any ideas anyone?
Thanks

@morrys
Copy link
Owner

morrys commented Jul 3, 2020

Hi @isocra,
in AWS AppSync this is solved by creating a specific Apollo link:
https://github.com/awslabs/aws-mobile-appsync-sdk-js/blob/master/packages/aws-appsync/src/link/complex-object-link.ts

You could open a ticket and request that this link be distributed as an independent library, as they did for it here (https://github.com/awslabs/aws-mobile-appsync-sdk-js/tree/master/packages/aws -appsync-auth-link)

@morrys
Copy link
Owner

morrys commented Jul 3, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants