Why use AWS AppSync client on top of vue-apollo? - amazon-web-services

When using AWS AppSync as a backend GraphQL server, what are the advantages of using AppSync client on top of vue-apollo client? Can I just use vue-apollo to interact with my GraphQl server without using AppSync client?

Can you please share the specific use-cases or features looking for?
AppSync provides lot of the other features like real-time subscriptions, offline access, caching and enterprise security and fine-grained access control.

Related

Use AWS AppSync as a GraphQL Server

I am trying to connect my react native mobile app with graphql server. For that, as the graphql client I am using Apollo Client. I hope to use AWS services and, I have a problem in selecting the suitable graphql server.
Can I use AWS AppSync instead of using a separate GraphQL server such as ApolloServer, Express GraphQL etc.
Yes, you can use AWS AppSync as a GraphQL server on AWS. AWS AppSync is an AWS service for creating your fully managed GraphQL API layers. Since, it is a managed service, which means you don't need to worry about provisioning a server for your backend.
I would suggest you to use Serverless framework to manage and deploy your AppSync application. Here is the link for you to get started and will probably give you a good idea how to use Serverless for AppSync applications.
https://www.serverless.com/guides/aws-appsync

How can I set up ui-less external API auth using AWS?

I'm trying to create an external API using AWS API Gateway that will give users access to data stored in multiple databases. The APIs will mostly be accessed through scripts rather than through a web UI.
Are there any AWS services I can use to manage user access to my API?
I've read a little bit about Amazon Cognito and OAuth 2 but at a glance it seems like those might be more targeted towards cases with a UI for users to interact with. Is there a way to create and manage API keys with AWS?
Thanks in advance for your help!
You can use API Gateway Lambda Authorizer to write your custom login integration. For example a lambda that check in one Database if the user:password (passed as authorization header) exists in table in DynamoDB or SQL.

WSO2 Siddhi DynamoDB Store Extension

WSO2 siddhi currently doesn't have the extension for Amazon DynamoDB Store. Is there any possibility to connect DynamoDB as a storage backend for siddhi events?
Currently there is no connector for Amazon DynamoDB. Also AFAIK there is no REST API to interact with DynamoDB, only SDKs. If there is a REST API we might me able to use HTTP extension to connect with DynamoDB. However this is currently in roadmap and released in the future. If the requirement is urgent you can write your own DynamoDB store extension using java-SDK. Here is the guide for extension creation. You can refer MongoDB store implementation.

AWS Amplify -- AppSync Offline

Does Amplify support the Offline capabilities outlined here:
https://docs.aws.amazon.com/appsync/latest/devguide/building-a-client-app-react.html#offline-settings
Should I set it up like this?
https://aws.github.io/aws-amplify/media/api_guide#configuration-for-graphql-server
Or for offline capabilities, do I have to use something like Apollo?
There is a difference between AWS Amplify and AWS App Sync.
AWS Amplify is a library for web and mobile developement in JavaScript providing better access to AWS services like Auth, Analytics, Storage, APIs, Caching.
AWS AppSync is a combination of service that works as a GraphQL server and SDK (for web, iOS and Android). This SDK extends Apollo Client to provide capabilities like Offline and Realtime synchronization out of the box.
So, to answer your question: AWS AppSync does provide offline via its SDK out of the box and you shouldn’t need to do anything specifically to set up that.

How to save data from Cognito Sync to the server

I have a rails 3.2 server, Android App, our own API and AWS Cognito. Our backend is using PostgreSQL. How do I save the datasets created in cognito sync to our database? Should I listen for the callback of cognito sync's success then save the data using our API? or should I use the aws-sdk at the rails server to get the dataset? I don't want the android app to talk directly to RDS and S3.
I think you could use Cognito Events for that: You can set up an Amazon Lambda function that will trigger every time a dataset is updated so you can implement your own logic there.
Cognito Streams would also work, and might be faster because it's async: it makes every dataset update be written to a Kinesis stream, and then you can make your backend consume from that stream.
Updated as above link was not working.
https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-events.html
https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-streams.html
AWS AppSync simplifies application development by letting you create a flexible API to securely access, manipulate, and combine data from one or more data sources. AppSync is a managed service that uses GraphQL to make it easy for applications to get exactly the data they need.
If you're new to Amazon Cognito Sync, use AWS AppSync. Like Amazon
Cognito Sync, AWS AppSync is a service for synchronizing application
data across devices.
A single GraphQL API to deliver private and public data. Private data requires authenticated access using authorization mechanisms such as IAM, Amazon Cognito User Pools, and OIDC. Public data does not require authenticated access and is delivered through authorization mechanisms such as API Keys.
https://aws.amazon.com//appsync/
You can use aws-amplify to sync
https://aws-amplify.github.io/docs/js/api
https://forums.aws.amazon.com/message.jspa?messageID=918861
https://aws.amazon.com/blogs/mobile/using-multiple-authorization-types-with-aws-appsync-graphql-apis/
https://medium.com/open-graphql/authenticating-an-aws-appsync-graphql-api-with-auth0-48835691810a
https://hackernoon.com/aws-appsync-queries-and-mutations-with-lambda-2aee303c66b0