Amplify-js: Amplify AppSync vs AWSAppSyncClient?

Created on 8 Aug 2018  路  5Comments  路  Source: aws-amplify/amplify-js

I am having trouble understanding this from the documentation.

I found this example repo:
https://github.com/aws-samples/aws-amplify-graphql/blob/master/photo-client/src/App.js

In which it imports both aws-appsync module and the amplify module.

I initially thought these were mutually exclusive, meaning the amplify module came with everything you needed to connect to AppSync and the aws-appsync module was unnecessary if using Amplify.

But that project is using them both. Why?

What would be the reason to use aws-appsync module rather than the appsync functionality built into Amplify?

Also another question partially related to this.

If I wanted to upload an image to S3 purely via the graphql functionality in Amplify, how would I do that? Is that possible?

GraphQL question

Most helpful comment

Suggestion : create a page with a clear comparison between the two solutions can help a lot a people. Cache and offline is the two subject to come to my mind but I'm sure I'm missing some stuff.

And, where can we find the roadmap about AWS Amplify & AppSync ? Thanks !

All 5 comments

AWSAppSyncClient integrates with the Apollo Client for GraphQL, which offers a few advanced features such as offline support and caching that AWS Amplify does not (currently) support, but that many people don't need anyway.

My recommendation would be to stick with AWS Amplify for AppSync until you need an advanced feature that Amplify doesn't support.

@D2KX thanks for your response! Is it still the case with the latest release of Amplify CLI toolchain? I couldn't find any documentation on this topic, but it seems that graphqlOperationAPI doesn't have any offline and caching support even when configured with AppSync, which we rely on for our projects, and it's still better to use AppSync's offline helper https://github.com/awslabs/aws-mobile-appsync-sdk-js/blob/master/OFFLINE_HELPERS.md or Apollo's Query/Mutation components?

Suggestion : create a page with a clear comparison between the two solutions can help a lot a people. Cache and offline is the two subject to come to my mind but I'm sure I'm missing some stuff.

And, where can we find the roadmap about AWS Amplify & AppSync ? Thanks !

@rygo6 @romainquellec @richardzyx @D2KX we updated our doc site explaining the difference between Amplify graphql client and AppSync SDK.

I will close the issue for now, but feel free to reopen in case something is not clear.

So do we need to use the AWSAppSyncClient for S3 uploads or is that something that can be accomplished just with the amplify version?

I tried and it does not upload the file. But wonder if there is anything I do wrong.

Was this page helpful?
0 / 5 - 0 ratings