aws-appsync

Authenticate AppSync request with adminInitiateAuth

偶尔善良 提交于 2019-12-24 22:45:27
问题 The post on https://read.acloud.guru/backend-graphql-how-to-trigger-an-aws-appsync-mutation-from-aws-lambda-eda13ebc96c3 describes a nice way to call AppSync mutations using a simple HTTP requests from a Lambda assuming that IAM authentication is being used on AppSync, but I would like to be able to do this with AMAZON_COGNITO_USER_POOLS. The way it is done there is by signing the request using IAM credentials. As far as I could determine, when AMAZON_COGNITO_USER_POOLS is used, the requests

How to keep AWS APPSync APIs in sync from Dev to Staging to Production?

删除回忆录丶 提交于 2019-12-24 19:13:56
问题 Let's say you have an AWS AppSync API named API-DEV . It hosts the GraphQL Schema, the Resolvers, the Data sources, DynamoDB tables (ex: Dev_Articles ), DynamoDB tables configuration, and DynamoDB data. The API is consumed by approx. 50 instances of the same React app. How would you automate the migration of newest features from API-DEV to API-STAGING ? Note that I want to update everything except data. Ways to go I'm thinking about: Keep a list of things to update, move the staging apps to

AppSync BatchResolver AssumeRole Error

馋奶兔 提交于 2019-12-23 17:55:37
问题 I’m trying to use the new DynamoDB BatchResolvers to write to two DynamoDB table in an AppSync resolver (currently using a Lambda function to do this). However, I’m getting the following permission error when looking at the CloudWatch logs: “User: arn:aws:sts::111111111111:assumed-role/appsync-datasource-ddb-xxxxxx-TABLE-ONE/APPSYNC_ASSUME_ROLE is not authorized to perform: dynamodb:BatchWriteItem on resource: arn:aws:dynamodb:us-east-1:111111111111:table/TABLE-TWO (Service: AmazonDynamoDBv2;

How to set AWS Appsync request timeout limit || AWSAppSync Client not giving callback

霸气de小男生 提交于 2019-12-23 13:15:52
问题 I'm using AWS Appsync for the current App I'm developing and facing a serious issue that is Whenever I fire queries in Appsync client, when there is slow internet connection the request never end with a callback. I checked over internet there is limited source of information on this topic and also found this issue that is still open. This is the code I used to get the response func getAllApi(completion:@escaping DataCallback){ guard isInternetAvailabele() else { completion(nil) return } //

Is there a way to test AppSync code locally and/or in CI/CD?

让人想犯罪 __ 提交于 2019-12-23 09:01:24
问题 I am looking to dive into a project using AppSync. So far I have been able to find plenty of articles and such online giving all the steps as to what buttons to click in order to get a sample project running, but none of them seem to touch on how one deals with it from a local development or in a CI/CD environment. Its probably my "old school" idea of how dev usually works, but I was expecting some way to simulate enough of the environment locally to do development and run unit tests, but I

How to get unseen, nearby documents from a Amplify - AppSync - ElasticSearch - DynamoDB Stack?

我怕爱的太早我们不能终老 提交于 2019-12-23 04:52:14
问题 Problem: Use Amplify.js from AWS. A Tinder similar app. Here you can find jobs close by. These may only be seen once. We should save what the user likes and dislikes. What I've already managed: I have the scheme: type Query { nearbyJobs(location: LocationInput!, km: Int): ModelJobConnection } type User @model { id: ID! name: String interacts: [Jobinteract] @connection(name: "interactsuser") createdAt: String updatedAt: String } type Job @model @searchable { id: ID! name: String location:

Apollo mutate calling update four times for a single mutation

旧街凉风 提交于 2019-12-23 03:51:54
问题 Every time I add a new item in my app, the mutation calls update() four times, for some reason. The first two are optimistic data, and in the second batch, one is optimistic and one is real data from the network. I can't make any sense of this. The new item being created shows up twice on the page. This is my mutation: mutation CreateTrack($name: String!, $trackNum: Int, $s3Key: String!) { createTrack(name: $name, trackNum: $trackNum, s3Key: $s3Key) { trackId name createdAt duration trackNum

GraphQL Query Runs Sucessfully One Time and Fails To Run Again using Apollo and AWS AppSync

佐手、 提交于 2019-12-23 02:44:29
问题 I'm using the basic client configuration from the example on the first page of https://github.com/awslabs/aws-mobile-appsync-sdk-js repo: const client = new AWSAppSyncClient({ url: appSyncConfig.graphqlEndpoint, region: appSyncConfig.region, auth: { type: appSyncConfig.authenticationType, apiKey: appSyncConfig.apiKey, } }); But without the <Rehydrated> component, and with a Redux <Provider> component. The highest level parent component is wrapped like this: <Provider store={store}>

GraphQL Query Runs Sucessfully One Time and Fails To Run Again using Apollo and AWS AppSync

青春壹個敷衍的年華 提交于 2019-12-23 02:44:06
问题 I'm using the basic client configuration from the example on the first page of https://github.com/awslabs/aws-mobile-appsync-sdk-js repo: const client = new AWSAppSyncClient({ url: appSyncConfig.graphqlEndpoint, region: appSyncConfig.region, auth: { type: appSyncConfig.authenticationType, apiKey: appSyncConfig.apiKey, } }); But without the <Rehydrated> component, and with a Redux <Provider> component. The highest level parent component is wrapped like this: <Provider store={store}>

React Native + AWS AppSync - maximum data storage

被刻印的时光 ゝ 提交于 2019-12-22 09:27:26
问题 I’m building an offline application which needs to store around 30,000 records. Will AWS AppSync have any performance issues with a data set of this size? I’ve used redux w/ redux-persist in the past, which saves the store offline, then refetchs and places in memory when the app launches. This causes fairly huge memory issues, especially when querying the data. I’m wondering if AppSync has the ability to use Realm or SQLite for offline storage and querying. Thanks. 来源: https://stackoverflow