我正在试验AppSync + DynamoDB。我希望在我的GraphQL模式中有以下类型:
type User {
user_id: String!
}
type Box {
name: String!
user: User!
}
如何在DynamoDB中创建存储指向另一个表的项的表(在我的示例中,我希望表BoxTable的字段user是对表UserTable中用户的引用)
如何在AppSync中定义上述模式?设置user: User!时,将得到错误Expected User! to be a GraphQL input type.
我正在尝试使用AppSync中的CDK来构建一个连接到DynamoDB表的Python。我希望这是一个只读的API,没有创建,删除,更新。在我的堆栈中,我添加了AppSync接口: # AppSync API for data and data catalogue queries
api = _appsync.GraphqlApi(self,
'DataQueryAPI',
name='dataqueryapi',
log_config=_appsync.LogConfig(field_log_level
我使用的是亚马逊AppSync网络控制台,我从头开始创建了一个新的API。
我创建了一个新资源,如下所示:
type ToDo {
id: ID!
title: String!
}
在亚马逊网络服务AppSync创建了DynamoDB表和模式后,如果我想要更新模式并添加新字段,我该怎么做?
type ToDo {
id: ID!
title: String!
completed: Boolean
}
我知道AWS Amplify有一个命令amplify api gql-compile,然后是amplify push,它将更新模式和DynamoDB表。
有没有办法从AWS A
我正在尝试使用新的DynamoDB BatchResolvers来写入AppSync解析器中的两个DynamoDB表(目前使用的是Lambda函数)。然而,在查看CloudWatch日志时,我得到了以下权限错误:
“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-
我试图替换Appsync API中的一个表,但现在收到以下错误: User: arn:aws:sts::164370900240:assumed-role/User-role-likbfqoe4zd3zd7bz5bl2y4z6i-test/APPSYNC_ASSUME_ROLE is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:us-east-1:164370900240:table/User-site-test (Service: AmazonDynamoDBv2; Status Cod
我在AWS DynamoDB中创建了一个庙宇名称BlogAuthor,其结构如下:
authorId | orgId | age |name
稍后,我需要进行如下查询:get all authors from organization id = orgId123 with age between 30 and 50, then sort their name in alphabet order。
我不确定在DynamoDB中是否能够执行这样的查询(稍后我将在AppSync中应用它),因此第一个解决方案是使用partitionKey=orgId,sortKey=age (最终名为orgId-ag
我希望使用query()从表中获取所有条目,而不是使用扫描,因为它非常昂贵。
如果没有.contains(),我可以使用table.scan()吗?
dynamodb = boto3.resource('dynamodb')
table= dynamodb.Table('investors')
data = table.scan(
FilterExpression=Attr('groups_name').contains('person_name')
)
# Something like this
data =