0

Here is the official documentation for AWS Amplify GraphQL Client: https://aws-amplify.github.io/amplify-js/media/api_guide.html. The section supplies an example for basic String inputs though.

For AWS Mobile Appsync SDK for Javascript, there is a detailed doc here: https://docs.aws.amazon.com/appsync/latest/devguide/building-a-client-app-react.html. However, I do not want to add another configuration for it -I already have one for Amplify.

So, how to upload files to S3 storage by using AWS Amplify and AWS AppSync as the backend, what extra configuration is needed for Amplify -if there is?

vahdet
  • 6,357
  • 9
  • 51
  • 106

1 Answers1

0

Http Endpoints are added as an option to be used as datasources to AppSync schemata, but as of time, there is no S3 bucket as an option. There are solutions like [this]( https://stackoverflow.com/a/50218870/4636715), but they require AWSAppSyncClient at Javascript side which would add complexity to the client code as Amplify is set up there already imho.

So, I ended up with using Storage of AWS Amplify -independent of AppSync. Then, I wait for the upload to be successful and call an AppSync mutation to store the key for the uploaded file in DynamoDB using regular datasource resolvers.

vahdet
  • 6,357
  • 9
  • 51
  • 106