aws-appsync

Manually sign AppSync URL to use in Lambda gives bad signature error

一世执手 提交于 2020-01-10 20:16:45
问题 In a Lambda, I would like to sign my AppSync endpoint with aws-signature-v4 in order to use it for a mutation. The URL generated seems to be ok but it gives me the following error when I try it : { "errors" : [ { "errorType" : "InvalidSignatureException", "message" : "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. etc... } ] } Here is my lambda function import {

How to paginate react-admin lists when the total is unknown?

牧云@^-^@ 提交于 2020-01-06 14:20:38
问题 Summary : I can't get a total number of records from my GraphQL endpoint. I only know if I have reached the end of my GraphQL records list when I am parsing the response from the endpoint. How can I make my custom pagination component aware that it's on the last page? Details : I'm using React Admin with AWS AppSync (GraphQL on DynamoDB) using ra-data-graphql . AppSync can't tell you the total number of records available to a list query, and it also limits the number of records you can return

How to Filter by Query on Nested Fields in AWS AppSync

六眼飞鱼酱① 提交于 2020-01-05 03:49:10
问题 Problem and Expected Results I'm using a proof of concept schema and DynamoDB Table setup to filter on nested field values. I've followed the ideas very generally here as well as the documentation for $utils.transform.toDynamoDBFilterExpression (here). The basic idea is this: using the same sort of principles, I'd like to filter by any arbitrarily deep nested field (short of the 32 document path length limit in DynamoDB). The relevant setup looks like this: AppSync schema (apologies for the

Subscribe to a List of Group / Private Chats in AWS AppSync

人盡茶涼 提交于 2020-01-01 07:09:10
问题 Im currently evaluating AWS AppSync as a backend solution for a messaging app. The users will have a view to explore new Chat Groups and a different view where they see a list of their joined and private Chats (In the list the name and the last message of the chats should be displayed). Each Chat will of course have a detail view where all the messages are displayed. The question is how to design the subscription part. My Mutation to send a message will look something like this: createMessage

AWS AppSync Authorization

喜你入骨 提交于 2019-12-31 22:27:12
问题 I'm planning to use AWS Appsync to migrate a graphQL endpoint in a lambda function, which is being triggered by a POST via the API Gateway. I'm looking into AppSync mainly because of the subscriptions, which I can't create using a Lambda function. My Authentication mechanism is based on Auth0, using passwordless, and my authorization mechanism in based on the data from several tables in DynamoDB and it's embedded in the graphQL resolvers, as recommended by Facebook and Apollo. What is more,

AWS AppSync Authorization

浪子不回头ぞ 提交于 2019-12-31 22:27:11
问题 I'm planning to use AWS Appsync to migrate a graphQL endpoint in a lambda function, which is being triggered by a POST via the API Gateway. I'm looking into AppSync mainly because of the subscriptions, which I can't create using a Lambda function. My Authentication mechanism is based on Auth0, using passwordless, and my authorization mechanism in based on the data from several tables in DynamoDB and it's embedded in the graphQL resolvers, as recommended by Facebook and Apollo. What is more,

DynamoDB AppSync field resolvers timing out

自闭症网瘾萝莉.ら 提交于 2019-12-31 04:58:06
问题 So I have the schema below. If I try to query data off this schema AppSync will time out saying 'NetworkError when attempting to fetch resource.' type Model { PartitionKey: ID! SortKey: ID! Name: String Version: Int FBX: String # ms since epoch CreatedAt: AWSTimestamp Description: String Tags: [Tag] } type ImageSet { PartitionKey: ID! SortKey: ID! Name: String CreatedAt: AWSTimestamp Description: String Tags: [String] } Now, if I change 'Name' in the model to 'ModelName' then queries on that

mutation to create relations on AWS AppSync

泄露秘密 提交于 2019-12-30 05:14:08
问题 I have been trying to run a mutation to create relations to two separate Types with not much success. ** SCHEMA ** (I have used "Create Resources" to create tables in DynamoDB) type Comment { eventId: ID! commentId: String! content: String } type CommentConnection { items: [Comment] nextToken: String } input CreateCommentInput { eventId: ID! commentId: String! content: String } input CreateEventInput { id: ID! name: String where: String when: String description: String } input

AWS appsync query resolver

孤街醉人 提交于 2019-12-25 02:15:29
问题 Currently I have my resolver as a lambda function : import boto3 from boto3.dynamodb.conditions import Key def lambda_handler(event, context): list = [] for device in event['source']['devices'] : dynamodb = boto3.resource('dynamodb') readings = dynamodb.Table('readings') response = readings.query( KeyConditionExpression=Key('device').eq(device['device']) ) items = response['Items'] list.extend(items) return list I would like to be able to have this as a VTL resolver on the dynamodb. My

Lambda functions to query the GraphQL endpoint?

◇◆丶佛笑我妖孽 提交于 2019-12-25 01:39:11
问题 How can I use Lambda functions to query the GraphQL endpoint (AppSync) in Node.js? Which GraphQL Client should I use? I have seen AWS AppSync JavaScript SDK which seems to be for mobile app or react/frontend. PS: I am not talking about AWS Lambda Resolvers. 回答1: We use a simple https package to query graphql. You might need to form all the graphql queries manually in that case. If you want to use deal with automated discovery and query with objects you can apollo-fetch clients. Simple CURL